Class: Tco::Segment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, params) ⇒ Segment

Returns a new instance of Segment.



41
42
43
44
# File 'lib/tco/parser.rb', line 41

def initialize(value, params)
  @value = value
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



39
40
41
# File 'lib/tco/parser.rb', line 39

def params
  @params
end

#valueObject (readonly)

Returns the value of attribute value.



39
40
41
# File 'lib/tco/parser.rb', line 39

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

For rspec assertions



51
52
53
# File 'lib/tco/parser.rb', line 51

def ==(other)
  @value == other.value && @params == other.params
end

#to_sObject



46
47
48
# File 'lib/tco/parser.rb', line 46

def to_s
  @value
end