Class: RubyRTL::Ast

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_rtl/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



17
18
19
# File 'lib/ruby_rtl/ast.rb', line 17

def comments
  @comments
end

Instance Method Details

#accept(visitor, arg = nil) ⇒ Object



18
19
20
21
# File 'lib/ruby_rtl/ast.rb', line 18

def accept(visitor, arg=nil)
  name = self.class.name.split(/::/)[1]
  visitor.send("visit#{name}".to_sym, self ,arg) # Metaprograming !
end