Class: Twostroke::AST::DoWhile
- Defined in:
- lib/twostroke/ast/do_while.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#condition ⇒ Object
Returns the value of attribute condition.
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
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/twostroke/ast/do_while.rb', line 3 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition.
3 4 5 |
# File 'lib/twostroke/ast/do_while.rb', line 3 def condition @condition end |
Instance Method Details
#collapse ⇒ Object
5 6 7 |
# File 'lib/twostroke/ast/do_while.rb', line 5 def collapse self.class.new body: body.collapse, condition: condition.collapse end |
#walk(&bk) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/twostroke/ast/do_while.rb', line 9 def walk(&bk) if yield self condition.walk &bk body.walk &bk end end |