Class: Differential::Parser::Id

Inherits:
Object
  • Object
show all
Defined in:
lib/differential/parser/id.rb

Overview

TODO

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



14
15
16
# File 'lib/differential/parser/id.rb', line 14

def data
  @data
end

#valueObject (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_sObject



21
22
23
# File 'lib/differential/parser/id.rb', line 21

def to_s
  value
end