Class: Wongi::Engine::InequalityTest
- Inherits:
-
FilterTest
- Object
- FilterTest
- Wongi::Engine::InequalityTest
- Defined in:
- lib/wongi-engine/beta/filter_node.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) ⇒ InequalityTest
constructor
A new instance of InequalityTest.
- #passes?(token) ⇒ Boolean
Methods inherited from FilterTest
Constructor Details
#initialize(x, y) ⇒ InequalityTest
Returns a new instance of InequalityTest.
60 61 62 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 60 def initialize x, y @x, @y = x, y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
58 59 60 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 58 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
58 59 60 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 58 def y @y end |
Instance Method Details
#==(other) ⇒ Object
83 84 85 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 83 def == other super && x == other.x && y == other.y end |
#passes?(token) ⇒ Boolean
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 64 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 == :_ return x != y end |