Class: Leftovers::Processors::MatchMatchedNode
- Inherits:
-
Object
- Object
- Leftovers::Processors::MatchMatchedNode
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/match_matched_node.rb
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
-
#then_processor ⇒ Object
readonly
Returns the value of attribute then_processor.
Instance Method Summary collapse
-
#initialize(matcher, then_processor) ⇒ MatchMatchedNode
constructor
A new instance of MatchMatchedNode.
- #process(str, current_node, matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(matcher, then_processor) ⇒ MatchMatchedNode
Returns a new instance of MatchMatchedNode.
10 11 12 13 14 15 |
# File 'lib/leftovers/processors/match_matched_node.rb', line 10 def initialize(matcher, then_processor) @matcher = matcher @then_processor = then_processor freeze end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
8 9 10 |
# File 'lib/leftovers/processors/match_matched_node.rb', line 8 def matcher @matcher end |
#then_processor ⇒ Object (readonly)
Returns the value of attribute then_processor.
8 9 10 |
# File 'lib/leftovers/processors/match_matched_node.rb', line 8 def then_processor @then_processor end |
Instance Method Details
#process(str, current_node, matched_node, acc) ⇒ Object
17 18 19 20 21 |
# File 'lib/leftovers/processors/match_matched_node.rb', line 17 def process(str, current_node, matched_node, acc) return unless @matcher === matched_node @then_processor.process(str, current_node, matched_node, acc) end |