Class: Wongi::Engine::AssertingTest
- Inherits:
-
FilterTest
- Object
- FilterTest
- Wongi::Engine::AssertingTest
- Defined in:
- lib/wongi-engine/filter/asserting_test.rb
Instance Method Summary collapse
-
#initialize(*vars, &body) ⇒ AssertingTest
constructor
A new instance of AssertingTest.
- #passes?(token) ⇒ Boolean
Methods inherited from FilterTest
Constructor Details
#initialize(*vars, &body) ⇒ AssertingTest
Returns a new instance of AssertingTest.
5 6 7 8 |
# File 'lib/wongi-engine/filter/asserting_test.rb', line 5 def initialize *vars, &body @vars = vars @body = body end |
Instance Method Details
#passes?(token) ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/wongi-engine/filter/asserting_test.rb', line 10 def passes? token if @vars.empty? @body.call token else @body.call *( @vars.map { |var| token[var] } ) end end |