Class: NT54::Parser::Visitor

Inherits:
Object
  • Object
show all
Defined in:
lib/nt54/parser/visitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number) ⇒ Visitor

Returns a new instance of Visitor.



7
8
9
10
# File 'lib/nt54/parser/visitor.rb', line 7

def initialize(number)
  NT54.log.debug "new state: #{to_sym}" if NT54.log
  @number = number
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/nt54/parser/visitor.rb', line 5

def number
  @number
end

Instance Method Details

#accept(keypress) ⇒ Object



12
13
14
15
# File 'lib/nt54/parser/visitor.rb', line 12

def accept(keypress)
  NT54.log.debug "got #{keypress}" if NT54.log
  return nil
end

#to_symObject



17
18
19
# File 'lib/nt54/parser/visitor.rb', line 17

def to_sym
  self.class.to_s.split("::").last.to_sym
end