class Wongi::Engine::GreaterThanOrEqualTest

Attributes

x[R]
y[R]

Public Class Methods

new(x, y) click to toggle source
Calls superclass method
# File lib/wongi-engine/filter/greater_than_or_equal_test.rb, line 7
def initialize(x, y)
  super()
  @x = x
  @y = y
end

Public Instance Methods

==(other) click to toggle source
# File lib/wongi-engine/filter/greater_than_or_equal_test.rb, line 31
def ==(other)
  self.class == other.class && x == other.x && y == other.y
end
passes?(token) click to toggle source
# File lib/wongi-engine/filter/greater_than_or_equal_test.rb, line 13
def passes?(token)
  x = if Template.variable? @x
        token[@x]
      else
        @x
      end

  y = if Template.variable? @y
        token[@y]
      else
        @y
      end

  return false if x == :_ || y == :_

  x >= y
end
to_s() click to toggle source
# File lib/wongi-engine/filter/greater_than_or_equal_test.rb, line 35
def to_s
  "#{x} >= #{y}"
end