Class: ORTools::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/or_tools/comparison.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#leftObject (readonly)

Returns the value of attribute left.



3
4
5
# File 'lib/or_tools/comparison.rb', line 3

def left
  @left
end

#opObject (readonly)

Returns the value of attribute op.



3
4
5
# File 'lib/or_tools/comparison.rb', line 3

def op
  @op
end

#rightObject (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

#inspectObject Also known as: to_s



11
12
13
# File 'lib/or_tools/comparison.rb', line 11

def inspect
  "#{@left.inspect} #{@op} #{@right.inspect}"
end