Class: DParse::Parsers::Capturing
- Inherits:
-
DParse::Parser
- Object
- DParse::Parser
- DParse::Parsers::Capturing
- Defined in:
- lib/d-parse/parsers/modifiers/capturing.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Capturing
constructor
A new instance of Capturing.
Methods inherited from DParse::Parser
#apply, #bind, #capture, #compact, #expectation_message, #first, #flatten, #ignore, #inspect, #map, #match?, #read, #second, #select_even, #select_odd, #to_s
Constructor Details
#initialize ⇒ Capturing
Returns a new instance of Capturing.
8 9 10 |
# File 'lib/d-parse/parsers/modifiers/capturing.rb', line 8 def initialize(*) raise ArgumentError, "#{self.class} is not supposed to be initialized" end |
Class Method Details
.new(parser) ⇒ Object
4 5 6 |
# File 'lib/d-parse/parsers/modifiers/capturing.rb', line 4 def self.new(parser) parser.map { |_data, result, old_pos| result.input[old_pos.index...result.pos.index] } end |