Class: Gecode::SetElements::SetElementsOperand
- Inherits:
-
Object
- Object
- Gecode::SetElements::SetElementsOperand
- Includes:
- Operand
- Defined in:
- lib/gecoder/interface/constraints/set_elements_constraints.rb
Overview
A SetElementsOperand is an uncommon operand that results from calling SetOperand#elements. It facilitates placing the constraints defined in SetElementsConstraintReceiver
Examples
Producing a SetElementsOperand from set_operand
:
set_operand.elements
Instance Method Summary collapse
-
#initialize(set) ⇒ SetElementsOperand
constructor
Constructs a new set elements operand
set
. -
#model ⇒ Object
:nodoc:.
-
#to_set_elements ⇒ Object
Returns the set operand that makes up the set elements operand.
Methods included from Operand
Constructor Details
#initialize(set) ⇒ SetElementsOperand
Constructs a new set elements operand set
.
18 19 20 21 22 23 24 |
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 18 def initialize(set) #:nodoc: unless set.respond_to? :to_set_var raise TypeError, "Expected set operand, got #{set.class}." end @set = set end |
Instance Method Details
#model ⇒ Object
:nodoc:
31 32 33 |
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 31 def model #:nodoc: @set.model end |
#to_set_elements ⇒ Object
Returns the set operand that makes up the set elements operand.
27 28 29 |
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 27 def to_set_elements #:nodoc: return @set end |