Class: Janeway::Interpreters::ChildSegmentDeleteIf

Inherits:
ChildSegmentInterpreter show all
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

Base::NOTHING

Instance Attribute Summary

Attributes inherited from Base

#next, #node

Instance Method Summary collapse

Methods inherited from ChildSegmentInterpreter

#as_json, #interpret, #push

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