Class: Postscript::Model::Operators::Container::Getinterval
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Container::Getinterval
- Defined in:
- lib/postscript/model/operators/container.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operand:, start:, count:) ⇒ Getinterval
constructor
A new instance of Getinterval.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:, start:, count:) ⇒ Getinterval
Returns a new instance of Getinterval.
54 55 56 57 58 59 |
# File 'lib/postscript/model/operators/container.rb', line 54 def initialize(operand:, start:, count:) @operand = operand @start = start @count = count freeze end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
53 54 55 |
# File 'lib/postscript/model/operators/container.rb', line 53 def count @count end |
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
53 54 55 |
# File 'lib/postscript/model/operators/container.rb', line 53 def operand @operand end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
53 54 55 |
# File 'lib/postscript/model/operators/container.rb', line 53 def start @start end |
Class Method Details
.from_operands(stack) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/postscript/model/operators/container.rb', line 60 def self.from_operands(stack) count = stack.pop_number.to_i start = stack.pop_number.to_i coll = stack.pop new(operand: coll, start: start, count: count) end |