Class: Twostroke::AST::Call
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#callee ⇒ Object
Returns the value of attribute callee.
Instance Method Summary collapse
- #collapse ⇒ Object
-
#initialize(*args) ⇒ Call
constructor
A new instance of Call.
- #walk(&bk) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Call
Returns a new instance of Call.
5 6 7 8 |
# File 'lib/twostroke/ast/call.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/call.rb', line 3 def arguments @arguments end |
#callee ⇒ Object
Returns the value of attribute callee.
3 4 5 |
# File 'lib/twostroke/ast/call.rb', line 3 def callee @callee end |
Instance Method Details
#collapse ⇒ Object
10 11 12 |
# File 'lib/twostroke/ast/call.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/call.rb', line 14 def walk(&bk) if yield self callee.walk &bk arguments.each { |arg| arg.walk &bk } end end |