Class: Differential::Parser::Id
- Inherits:
-
Object
- Object
- Differential::Parser::Id
- Defined in:
- lib/differential/parser/id.rb
Overview
TODO
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(data) ⇒ Id
constructor
A new instance of Id.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Id
16 17 18 19 |
# File 'lib/differential/parser/id.rb', line 16 def initialize(data) @data = Array(data) @value = make_value(data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/differential/parser/id.rb', line 14 def data @data end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
14 15 16 |
# File 'lib/differential/parser/id.rb', line 14 def value @value end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 |
# File 'lib/differential/parser/id.rb', line 33 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
25 26 27 28 29 30 31 |
# File 'lib/differential/parser/id.rb', line 25 def eql?(other) if other.is_a?(self.class) value == other.value else make_value(other) == value end end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/differential/parser/id.rb', line 21 def to_s value end |