Class: MiniArray

Inherits:
Object show all
Extended by:
Forwardable
Defined in:
lib/multimap/spec/spec_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = []) ⇒ MiniArray

Returns a new instance of MiniArray.



40
41
42
# File 'lib/multimap/spec/spec_helper.rb', line 40

def initialize(data = [])
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



38
39
40
# File 'lib/multimap/spec/spec_helper.rb', line 38

def data
  @data
end

Instance Method Details

#<=>(other) ⇒ Object



63
64
65
# File 'lib/multimap/spec/spec_helper.rb', line 63

def <=>(other)
  @data <=> other.data
end

#==(other) ⇒ Object



50
51
52
# File 'lib/multimap/spec/spec_helper.rb', line 50

def ==(other)
  other.is_a?(self.class) && @data == other.data
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/multimap/spec/spec_helper.rb', line 54

def eql?(other)
  other.is_a?(self.class) && @data.eql?(other.data)
end

#hashObject



59
60
61
# File 'lib/multimap/spec/spec_helper.rb', line 59

def hash
  @data.hash
end

#initialize_copy(orig) ⇒ Object



44
45
46
# File 'lib/multimap/spec/spec_helper.rb', line 44

def initialize_copy(orig)
  @data = orig.data.dup
end