Class: Postscript::Model::Operators::Container::Forall

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(collection:, body:) ⇒ Forall

Returns a new instance of Forall.



88
89
90
91
92
# File 'lib/postscript/model/operators/container.rb', line 88

def initialize(collection:, body:)
  @collection = collection
  @body = body
  freeze
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



87
88
89
# File 'lib/postscript/model/operators/container.rb', line 87

def body
  @body
end

#collectionObject (readonly)

Returns the value of attribute collection.



87
88
89
# File 'lib/postscript/model/operators/container.rb', line 87

def collection
  @collection
end

Class Method Details

.from_operands(stack) ⇒ Object



93
94
95
96
97
# File 'lib/postscript/model/operators/container.rb', line 93

def self.from_operands(stack)
  body = stack.pop
  coll = stack.pop
  new(collection: coll, body: body)
end