struct Wraith::ArrayStore(T)

Included Modules

Defined in:

wraithdb/stores/array_store.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def <<(elem : T) : self #

[View source]
def ==(other_array) : Bool #
Description copied from struct Struct

Returns true if this struct is equal to other.

Both structs' instance vars are compared to each other. Thus, two structs are considered equal if each of their instance variables are equal. Subclasses should override this method to provide specific equality semantics.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p2 = Point.new 1, 2
p3 = Point.new 3, 4

p1 == p2 # => true
p1 == p3 # => false

[View source]
def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []=(index : Int, value : T) #

[View source]
def []=(range : Range, value : T) #

[View source]
def all?(*args, **options) #

[View source]
def all?(*args, **options, &) #

[View source]
def any?(*args, **options) #

[View source]
def any?(*args, **options, &) #

[View source]
def assign(new_array : Array(T)) #

[View source]
def compact(*args, **options) #

[View source]
def compact(*args, **options, &) #

[View source]
def compact! : self #

[View source]
def count(*args, **options) #

[View source]
def count(*args, **options, &) #

[View source]
def delete(obj) : T | Nil #

[View source]
def delete_at(index : Int) : self #

[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def each_with_index(*args, **options) #

[View source]
def each_with_index(*args, **options, &) #

[View source]
def first(*args, **options) #

[View source]
def first(*args, **options, &) #

[View source]
def index(*args, **options) #

[View source]
def index(*args, **options, &) #

[View source]
def join(*args, **options) #

[View source]
def join(*args, **options, &) #

[View source]
def last(*args, **options) #

[View source]
def last(*args, **options, &) #

[View source]
def map(*args, **options) #

[View source]
def map(*args, **options, &) #

[View source]
def max(*args, **options) #

[View source]
def max(*args, **options, &) #

[View source]
def min(*args, **options) #

[View source]
def min(*args, **options, &) #

[View source]
def minmax(*args, **options) #

[View source]
def minmax(*args, **options, &) #

[View source]
def pop : T #

[View source]
def push(value : T) #

Append. Pushes one value to the end of self, given that the type of the value is T (which might be a single type or a union of types). This method returns self, so several calls can be chained. See #pop for the opposite effect.

a = ["a", "b"]
a.push("c") # => ["a", "b", "c"]
a.push(1)   # Errors, because the array only accepts String.

a = ["a", "b"] of (Int32 | String)
a.push("c") # => ["a", "b", "c"]
a.push(1)   # => ["a", "b", "c", 1]

[View source]
def push(*values : T) : self #

Append multiple values. The same as #push, but takes an arbitrary number of values to push into self. Returns self.

a = ["a"]
a.push("b", "c") # => ["a", "b", "c"]

[View source]
def reject(*args, **options) #

[View source]
def reject(*args, **options, &) #

[View source]
def reject!(& : T -> ) : self #

Modifies self, deleting the elements in the collection for which the passed block returns true. Returns self.

ary = [1, 6, 2, 4, 8]
ary.reject! { |x| x > 3 }
ary # => [1, 2]

[View source]
def reject!(pattern) : self #

Modifies self, deleting the elements in the collection for which pattern === element.

ary = [1, 6, 2, 4, 8]
ary.reject!(3..7)
ary # => [1, 2, 8]

[View source]
def reverse(*args, **options) #

[View source]
def reverse(*args, **options, &) #

[View source]
def reverse! : self #

[View source]
def sample(*args, **options) #

[View source]
def sample(*args, **options, &) #

[View source]
def select(*args, **options) #

[View source]
def select(*args, **options, &) #

[View source]
def shift : T #

[View source]
def shuffle(*args, **options) #

[View source]
def shuffle(*args, **options, &) #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def store #

[View source]
def sum(*args, **options) #

[View source]
def sum(*args, **options, &) #

[View source]
def uniq(*args, **options) #

[View source]
def uniq(*args, **options, &) #

[View source]
def uniq! : self #

[View source]