Class: Twostroke::AST::With
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#statement ⇒ Object
Returns the value of attribute statement.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Twostroke::AST::Base
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/twostroke/ast/with.rb', line 3 def object @object end |
#statement ⇒ Object
Returns the value of attribute statement.
3 4 5 |
# File 'lib/twostroke/ast/with.rb', line 3 def statement @statement end |
Instance Method Details
#collapse ⇒ Object
5 6 7 |
# File 'lib/twostroke/ast/with.rb', line 5 def collapse self.class.new object: object.collapse, statement: statement && statement.collapse end |
#walk(&bk) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/twostroke/ast/with.rb', line 9 def walk(&bk) if yield self object.walk &bk statement.walk &bk end end |