Class: StructureDigest::SchemaParts::Value

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Value

Returns a new instance of Value.



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

def initialize(val)
  @value = val
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

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



17
18
19
# File 'lib/structure_digest/value.rb', line 17

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

#abstractObject



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

def abstract
  nil
end

#hashObject



21
# File 'lib/structure_digest/value.rb', line 21

def hash; [@value].hash; end

#serializeObject



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

def serialize
  "=#{@value}"
end