Class: Symbol

Inherits:
Object show all
Includes:
Kaiseki::Parseable
Defined in:
lib/mod_symbol.rb

Instance Method Summary collapse

Methods included from Kaiseki::Parseable

#&, #action, #and?, #cast, #filter, #list, #merge, #not!, #one_or_more, #optional, #override, #parse, #predicate?, #protect, #repeat, #set, #skip, #tag_error, #tag_result, #validate, #zero_or_more, #|

Instance Method Details

#from_instance_variableObject



20
21
22
23
24
25
26
# File 'lib/mod_symbol.rb', line 20

def from_instance_variable
	if self[0] == '@'
		self[1..-1].to_sym
	else
		self
	end
end

#to_instance_variableObject



12
13
14
15
16
17
18
# File 'lib/mod_symbol.rb', line 12

def to_instance_variable
	if self[0] == '@'
		self
	else
		:"@#{self}"
	end
end

#to_parseableObject



4
5
6
7
8
9
10
# File 'lib/mod_symbol.rb', line 4

def to_parseable
	if self == :EOF
		Kaiseki::EOFParser.new
	else
		Kaiseki::SymbolParser.new self
	end
end