class Integer

Integer can be added to expressions or variables or multiplied by them to create expressions:

4 - (3 * x)
y / 2

Public Instance Methods

*(other) click to toggle source
# File lib/rams/numeric.rb, line 22
def *(other)
  return other * self if other.is_a? RAMS::Expression
  old_multiply other
end
Also aliased as: old_multiply
+(other) click to toggle source
# File lib/rams/numeric.rb, line 12
def +(other)
  return other + self if other.is_a? RAMS::Expression
  old_add other
end
Also aliased as: old_add
-(other) click to toggle source
# File lib/rams/numeric.rb, line 17
def -(other)
  return -other + self if other.is_a? RAMS::Expression
  old_sub other
end
Also aliased as: old_sub
/(other) click to toggle source
# File lib/rams/numeric.rb, line 27
def /(other)
  return other * (1.0 / self) if other.is_a? RAMS::Expression
  old_divide other
end
Also aliased as: old_divide
old_add(other)
Alias for: +
old_divide(other)
Alias for: /
old_multiply(other)
Alias for: *
old_sub(other)
Alias for: -