Class: Postscript::Model::Operators::ControlFlow::Exec

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/control_flow.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postscript::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(operand:) ⇒ Exec

Returns a new instance of Exec.



96
97
98
99
# File 'lib/postscript/model/operators/control_flow.rb', line 96

def initialize(operand:)
  @operand = operand
  freeze
end

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



95
96
97
# File 'lib/postscript/model/operators/control_flow.rb', line 95

def operand
  @operand
end

Class Method Details

.from_operands(stack) ⇒ Object



100
101
102
# File 'lib/postscript/model/operators/control_flow.rb', line 100

def self.from_operands(stack)
  new(operand: stack.pop)
end