Class: Changit::Lexer::KeyValueToken
- Inherits:
-
Object
- Object
- Changit::Lexer::KeyValueToken
- Defined in:
- lib/changit/lexer/key_value_token.rb
Instance Attribute Summary collapse
-
#lhs ⇒ Object
readonly
left-hand side.
-
#rhs ⇒ Object
right-hand side.
Instance Method Summary collapse
-
#initialize(key_value) ⇒ KeyValueToken
constructor
A new instance of KeyValueToken.
- #to_s ⇒ Object
Constructor Details
#initialize(key_value) ⇒ KeyValueToken
Returns a new instance of KeyValueToken.
7 8 9 |
# File 'lib/changit/lexer/key_value_token.rb', line 7 def initialize(key_value) @lhs, @rhs = key_value.split('=').map(&:strip) end |
Instance Attribute Details
#lhs ⇒ Object (readonly)
left-hand side
4 5 6 |
# File 'lib/changit/lexer/key_value_token.rb', line 4 def lhs @lhs end |
#rhs ⇒ Object
right-hand side
5 6 7 |
# File 'lib/changit/lexer/key_value_token.rb', line 5 def rhs @rhs end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/changit/lexer/key_value_token.rb', line 11 def to_s "\t#{@lhs} = #{@rhs}\n" end |