Class: StructureDigest::SchemaParts::ArrayDereference

Inherits:
Object
  • Object
show all
Defined in:
lib/structure_digest/array_dereference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ ArrayDereference

Returns a new instance of ArrayDereference.



5
6
7
# File 'lib/structure_digest/array_dereference.rb', line 5

def initialize(index)
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



4
5
6
# File 'lib/structure_digest/array_dereference.rb', line 4

def index
  @index
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



9
10
11
# File 'lib/structure_digest/array_dereference.rb', line 9

def ==(other)
  self.class == other.class && @index == other.index
end

#abstractObject



15
16
17
# File 'lib/structure_digest/array_dereference.rb', line 15

def abstract
  AbstractArrayDereference.new
end

#hashObject



14
# File 'lib/structure_digest/array_dereference.rb', line 14

def hash; [@index].hash; end