Class: StructureDigest::SchemaParts::HashDereference
- Inherits:
-
Object
- Object
- StructureDigest::SchemaParts::HashDereference
- Defined in:
- lib/structure_digest/hash_dereference.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #abstract ⇒ Object
- #hash ⇒ Object
-
#initialize(key) ⇒ HashDereference
constructor
A new instance of HashDereference.
- #serialize ⇒ Object
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
#key ⇒ Object (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 |
#abstract ⇒ Object
12 13 14 |
# File 'lib/structure_digest/hash_dereference.rb', line 12 def abstract self end |
#hash ⇒ Object
20 |
# File 'lib/structure_digest/hash_dereference.rb', line 20 def hash; [@key].hash; end |
#serialize ⇒ Object
8 9 10 |
# File 'lib/structure_digest/hash_dereference.rb', line 8 def serialize ".#{key}" end |