Class: StructureDigest::SchemaParts::HashDereference

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ HashDereference

Returns a new instance of HashDereference.



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

def initialize(key)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

Instance Method Details

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



16
17
18
# File 'lib/structure_digest/hash_dereference.rb', line 16

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

#abstractObject



12
13
14
# File 'lib/structure_digest/hash_dereference.rb', line 12

def abstract
  self
end

#hashObject



20
# File 'lib/structure_digest/hash_dereference.rb', line 20

def hash; [@key].hash; end

#serializeObject



8
9
10
# File 'lib/structure_digest/hash_dereference.rb', line 8

def serialize
  ".#{key}"
end