Class: Wongi::Engine::EqualityTest
- Inherits:
-
FilterTest
- Object
- FilterTest
- Wongi::Engine::EqualityTest
- 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) ⇒ EqualityTest
constructor
A new instance of EqualityTest.
- #passes?(token) ⇒ Boolean
Methods inherited from FilterTest
Constructor Details
#initialize(x, y) ⇒ EqualityTest
Returns a new instance of EqualityTest.
27 28 29 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 27 def initialize x, y @x, @y = x, y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
25 26 27 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 25 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
25 26 27 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 25 def y @y end |
Instance Method Details
#==(other) ⇒ Object
50 51 52 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 50 def == other super && x == other.x && y == other.y end |
#passes?(token) ⇒ Boolean
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/wongi-engine/beta/filter_node.rb', line 31 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 |