Class: Changit::Lexer::KeyValueToken

Inherits:
Object
  • Object
show all
Defined in:
lib/changit/lexer/key_value_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lhsObject (readonly)

left-hand side



4
5
6
# File 'lib/changit/lexer/key_value_token.rb', line 4

def lhs
  @lhs
end

#rhsObject

right-hand side



5
6
7
# File 'lib/changit/lexer/key_value_token.rb', line 5

def rhs
  @rhs
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/changit/lexer/key_value_token.rb', line 11

def to_s
  "\t#{@lhs} = #{@rhs}\n"
end