Class: Twostroke::AST::New
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#callee ⇒ Object
Returns the value of attribute callee.
Attributes inherited from Base
Instance Method Summary collapse
- #collapse ⇒ Object
-
#initialize(*args) ⇒ New
constructor
A new instance of New.
- #walk(&bk) ⇒ Object
Constructor Details
#initialize(*args) ⇒ New
Returns a new instance of New.
5 6 7 8 |
# File 'lib/twostroke/ast/new.rb', line 5 def initialize(*args) @arguments = [] super *args end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/twostroke/ast/new.rb', line 3 def arguments @arguments end |
#callee ⇒ Object
Returns the value of attribute callee.
3 4 5 |
# File 'lib/twostroke/ast/new.rb', line 3 def callee @callee end |
Instance Method Details
#collapse ⇒ Object
10 11 12 |
# File 'lib/twostroke/ast/new.rb', line 10 def collapse self.class.new callee: callee.collapse, arguments: arguments.map(&:collapse) end |
#walk(&bk) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/twostroke/ast/new.rb', line 14 def walk(&bk) if yield self callee.walk &bk arguments.each { |a| a.walk &bk } end end |