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



19
20
21
# File 'lib/structure_digest/array_dereference.rb', line 19

def abstract
  AbstractArrayDereference.new
end

#hashObject



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

def hash; [@index].hash; end

#serializeObject



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

def serialize
  "[#{@index}]"
end