Class: CompactData::Tokeniser::Token
- Inherits:
-
Object
- Object
- CompactData::Tokeniser::Token
- Defined in:
- lib/compactdata/tokeniser/tokeniser.rb
Overview
A class to represent CompactData tokens
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, from, to) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(type, value, from, to) ⇒ Token
Returns a new instance of Token.
12 13 14 15 16 17 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 12 def initialize(type, value, from, to) @type = type @value = value @from = from @to = to end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
10 11 12 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 10 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
10 11 12 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 10 def to @to end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 10 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 10 def value @value end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/compactdata/tokeniser/tokeniser.rb', line 19 def to_s "type: #{@type}, from: #{@from}, to: #{@to}, value: \"#{@value}\"" end |