Class: Postscript::Model::Operators::ControlFlow::Loop
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::ControlFlow::Loop
- Defined in:
- lib/postscript/model/operators/control_flow.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(body:) ⇒ Loop
constructor
A new instance of Loop.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(body:) ⇒ Loop
Returns a new instance of Loop.
57 58 59 60 |
# File 'lib/postscript/model/operators/control_flow.rb', line 57 def initialize(body:) @body = body freeze end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
56 57 58 |
# File 'lib/postscript/model/operators/control_flow.rb', line 56 def body @body end |
Class Method Details
.from_operands(stack) ⇒ Object
61 62 63 |
# File 'lib/postscript/model/operators/control_flow.rb', line 61 def self.from_operands(stack) new(body: stack.pop) end |