Class: Quicopt::PartRead Private
- Inherits:
-
Object
- Object
- Quicopt::PartRead
- Defined in:
- lib/quicopt/structured.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A read of a partition: the part of an item (counted from 0), or the number
of items in a part. One factor of an Expression.
Instance Attribute Summary collapse
-
#op ⇒ Symbol
readonly
private
:part_ofor:size_of. -
#order ⇒ Array
readonly
private
Where this term sorts among a model's terms.
- #partition ⇒ Partition readonly private
-
#position ⇒ Integer
readonly
private
The item (for
:part_of) or the part (for:size_of).
Instance Method Summary collapse
-
#initialize(partition, op, position, order) ⇒ PartRead
constructor
private
A new instance of PartRead.
- #model ⇒ Model private
-
#to_s ⇒ String
private
The read as written, e.g.
-
#variables ⇒ Array<Variable>
private
None: a read of a partition involves no variable.
Constructor Details
#initialize(partition, op, position, order) ⇒ PartRead
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PartRead.
380 381 382 383 384 385 386 |
# File 'lib/quicopt/structured.rb', line 380 def initialize(partition, op, position, order) @partition = partition @op = op @position = position @order = order freeze end |
Instance Attribute Details
#op ⇒ Symbol (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns :part_of or :size_of.
374 375 376 |
# File 'lib/quicopt/structured.rb', line 374 def op @op end |
#order ⇒ Array (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns where this term sorts among a model's terms.
378 379 380 |
# File 'lib/quicopt/structured.rb', line 378 def order @order end |
#partition ⇒ Partition (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
372 373 374 |
# File 'lib/quicopt/structured.rb', line 372 def partition @partition end |
#position ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the item (for :part_of) or the part (for :size_of).
376 377 378 |
# File 'lib/quicopt/structured.rb', line 376 def position @position end |
Instance Method Details
#model ⇒ Model
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
389 390 391 |
# File 'lib/quicopt/structured.rb', line 389 def model @partition.model end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the read as written, e.g. teams.part_of(2).
399 400 401 |
# File 'lib/quicopt/structured.rb', line 399 def to_s "#{@partition.name}.#{@op}(#{@position})" end |
#variables ⇒ Array<Variable>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns none: a read of a partition involves no variable.
394 395 396 |
# File 'lib/quicopt/structured.rb', line 394 def variables [] end |