Class: Pacer::Pipes::SimpleVisitorPipe
- Defined in:
- lib/pacer/pipe/simple_visitor_pipe.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#in_section ⇒ Object
readonly
Returns the value of attribute in_section.
-
#use_after_element ⇒ Object
Returns the value of attribute use_after_element.
-
#use_on_element ⇒ Object
Returns the value of attribute use_on_element.
-
#use_on_raw_element ⇒ Object
Returns the value of attribute use_on_raw_element.
-
#use_visitor_reset ⇒ Object
Returns the value of attribute use_visitor_reset.
-
#visitor ⇒ Object
Returns the value of attribute visitor.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Attributes inherited from RubyPipe
Instance Method Summary collapse
-
#initialize(wrapper, graph) ⇒ SimpleVisitorPipe
constructor
A new instance of SimpleVisitorPipe.
- #processNextStart ⇒ Object
- #reset ⇒ Object
Methods inherited from RubyPipe
Constructor Details
#initialize(wrapper, graph) ⇒ SimpleVisitorPipe
Returns a new instance of SimpleVisitorPipe.
8 9 10 11 12 13 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 8 def initialize(wrapper, graph) super() @in_section = false @wrapper = wrapper @graph = graph end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
4 5 6 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 4 def graph @graph end |
#in_section ⇒ Object (readonly)
Returns the value of attribute in_section.
4 5 6 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 4 def in_section @in_section end |
#use_after_element ⇒ Object
Returns the value of attribute use_after_element.
6 7 8 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 6 def use_after_element @use_after_element end |
#use_on_element ⇒ Object
Returns the value of attribute use_on_element.
6 7 8 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 6 def use_on_element @use_on_element end |
#use_on_raw_element ⇒ Object
Returns the value of attribute use_on_raw_element.
6 7 8 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 6 def use_on_raw_element @use_on_raw_element end |
#use_visitor_reset ⇒ Object
Returns the value of attribute use_visitor_reset.
6 7 8 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 6 def use_visitor_reset @use_visitor_reset end |
#visitor ⇒ Object
Returns the value of attribute visitor.
4 5 6 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 4 def visitor @visitor end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
4 5 6 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 4 def wrapper @wrapper end |
Instance Method Details
#processNextStart ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 23 def processNextStart visitor.after_element if use_after_element and in_section current = starts.next @in_section = true unless in_section visitor.on_raw_element current if use_on_raw_element if use_on_element wrapped = wrapper.new graph, current visitor.on_element(wrapped) end return current rescue EmptyPipe, java.util.NoSuchElementException @in_section = false raise EmptyPipe.instance end |
#reset ⇒ Object
38 39 40 41 42 |
# File 'lib/pacer/pipe/simple_visitor_pipe.rb', line 38 def reset visitor.visitor_reset if use_visitor_reset @in_section = false super end |