class Ilp::Constant

Attributes

value[RW]

Public Class Methods

new(value) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 4
def initialize(value)
  raise ArgumentError, "Argument is not numeric" unless value.is_a? Numeric
  @value = value
end

Public Instance Methods

*(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 29
def *(other)
  other * value
end
+(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 33
def +(other)
  other + value
end
-(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 37
def -(other)
  -1 * other + value
end
<(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 13
def <(other)
  other > value
end
<=(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 9
def <=(other)
  other >= value
end
==(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 25
def ==(other)
  other == value
end
>(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 21
def >(other)
  other < value
end
>=(other) click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 17
def >=(other)
  other <= value
end
pretty_print() click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 45
def pretty_print
  value.to_s
end
to_s() click to toggle source
# File lib/ruby-cbc/ilp/constant.rb, line 41
def to_s
  value.to_s
end