Class: Postscript::Model::Operators::Container::String

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/container.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(count:) ⇒ String

Returns a new instance of String.



160
161
162
163
# File 'lib/postscript/model/operators/container.rb', line 160

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

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



159
160
161
# File 'lib/postscript/model/operators/container.rb', line 159

def count
  @count
end

Class Method Details

.from_operands(stack) ⇒ Object



164
165
166
# File 'lib/postscript/model/operators/container.rb', line 164

def self.from_operands(stack)
  new(count: stack.pop_number.to_i)
end