Class: Janeway::Interpreters::ChildSegmentDeleteIf
- Inherits:
-
ChildSegmentInterpreter
- Object
- Base
- ChildSegmentInterpreter
- Janeway::Interpreters::ChildSegmentDeleteIf
- Defined in:
- lib/janeway/interpreters/child_segment_delete_if.rb
Overview
Child segment interpreter with selectors that delete matching elements if the given block yields a truthy value
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(child_segment, &block) ⇒ ChildSegmentDeleteIf
constructor
A new instance of ChildSegmentDeleteIf.
Methods inherited from ChildSegmentInterpreter
Methods inherited from Base
#as_json, #interpret, #selector, #to_s, #type
Constructor Details
#initialize(child_segment, &block) ⇒ ChildSegmentDeleteIf
11 12 13 14 15 16 17 |
# File 'lib/janeway/interpreters/child_segment_delete_if.rb', line 11 def initialize(child_segment, &block) super(child_segment) @selectors = child_segment.map do |expr| TreeConstructor.ast_node_to_delete_if(expr, &block) end end |