class So::Lt

Public Class Methods

lt(a, b) click to toggle source
# File lib/spec_object.rb, line 127
def self.lt(a, b)
  a = a.to_so_expr
  b = b.to_so_expr

  if a.kind_of?(Const) && b.kind_of?(Const)
    a.value < b.value
  elsif a.kind_of?(Time) && b.kind_of?(Time)
    a.n < b.n
  else
    new(a, b)
  end
end
new(a, b) click to toggle source
# File lib/spec_object.rb, line 122
def initialize(a, b)
  @a = a
  @b = b
end

Public Instance Methods

evaluate(calls) click to toggle source
# File lib/spec_object.rb, line 148
def evaluate(calls)
  Lt.lt(@a.evaluate(calls), @b.evaluate(calls))
end
pp(n) click to toggle source
# File lib/spec_object.rb, line 140
def pp(n)
  "#{' '*n}(<\n#{@a.pp(n+2)}\n#{@b.pp(n+2)})"
end
substitute(v, e) click to toggle source
# File lib/spec_object.rb, line 144
def substitute(v, e)
  Lt.lt(@a.substitute(v, e), @b.substitute(v, e))
end