Class: Wongi::Engine::GreaterThanOrEqualTest
- Inherits:
-
FilterTest
- Object
- FilterTest
- Wongi::Engine::GreaterThanOrEqualTest
- Defined in:
- lib/wongi-engine/filter/greater_than_or_equal_test.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(x, y) ⇒ GreaterThanOrEqualTest
constructor
A new instance of GreaterThanOrEqualTest.
- #passes?(token) ⇒ Boolean
- #to_s ⇒ Object
Methods inherited from FilterTest
Constructor Details
#initialize(x, y) ⇒ GreaterThanOrEqualTest
Returns a new instance of GreaterThanOrEqualTest.
7 8 9 10 11 |
# File 'lib/wongi-engine/filter/greater_than_or_equal_test.rb', line 7 def initialize(x, y) super() @x = x @y = y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
5 6 7 |
# File 'lib/wongi-engine/filter/greater_than_or_equal_test.rb', line 5 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
5 6 7 |
# File 'lib/wongi-engine/filter/greater_than_or_equal_test.rb', line 5 def y @y end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 |
# 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) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# 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 ⇒ Object
35 36 37 |
# File 'lib/wongi-engine/filter/greater_than_or_equal_test.rb', line 35 def to_s "#{x} >= #{y}" end |