Class: ORTools::Comparison
- Inherits:
-
Object
- Object
- ORTools::Comparison
- Defined in:
- lib/or_tools/comparison.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, op, right) ⇒ Comparison
constructor
A new instance of Comparison.
- #inspect ⇒ Object (also: #to_s)
Constructor Details
#initialize(left, op, right) ⇒ Comparison
Returns a new instance of Comparison.
5 6 7 8 9 |
# File 'lib/or_tools/comparison.rb', line 5 def initialize(left, op, right) @left = Expression.to_expression(left) @op = op @right = Expression.to_expression(right) end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
3 4 5 |
# File 'lib/or_tools/comparison.rb', line 3 def left @left end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
3 4 5 |
# File 'lib/or_tools/comparison.rb', line 3 def op @op end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
3 4 5 |
# File 'lib/or_tools/comparison.rb', line 3 def right @right end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
11 12 13 |
# File 'lib/or_tools/comparison.rb', line 11 def inspect "#{@left.inspect} #{@op} #{@right.inspect}" end |