Class: IcAgent::Ast::Writer
- Inherits:
-
Object
- Object
- IcAgent::Ast::Writer
- Defined in:
- lib/ic_agent/ast/writer.rb
Instance Method Summary collapse
-
#initialize(tree) ⇒ Writer
constructor
A new instance of Writer.
- #write(return_type = :string) ⇒ Object
Constructor Details
#initialize(tree) ⇒ Writer
Returns a new instance of Writer.
4 5 6 |
# File 'lib/ic_agent/ast/writer.rb', line 4 def initialize(tree) @tree = tree end |
Instance Method Details
#write(return_type = :string) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/ic_agent/ast/writer.rb', line 8 def write(return_type = :string) if return_type == :tree @tree elsif return_type == :array @tree.to_array else @tree.to_s end end |