Class: XapTreetop::KeyValuePair

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/xap/parser/xap_nodes.rb

Instance Method Summary collapse

Instance Method Details

#is_hex?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/xap/parser/xap_nodes.rb', line 45

def is_hex?
	value.val.is_a? HexValue
end

#keyObject



26
27
28
# File 'lib/xap/parser/xap_nodes.rb', line 26

def key
	keyword.text_value
end

#to_sObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/xap/parser/xap_nodes.rb', line 34

def to_s
	s = "#{key}"
	if is_hex?
		s << '!'
	else
		s << '='
	end
	s << value.val.text_value
	s
end

#valObject



30
31
32
# File 'lib/xap/parser/xap_nodes.rb', line 30

def val
	value.val.raw_value
end