Class: DParse::Parsers::Ignore
- Inherits:
-
DParse::Parser
- Object
- DParse::Parser
- DParse::Parsers::Ignore
- Defined in:
- lib/d-parse/parsers/modifiers/ignore.rb
Instance Method Summary collapse
-
#initialize(parser) ⇒ Ignore
constructor
A new instance of Ignore.
- #inspect ⇒ Object
- #read(input, pos) ⇒ Object
Methods inherited from DParse::Parser
#apply, #bind, #capture, #compact, #expectation_message, #first, #flatten, #ignore, #map, #match?, #second, #select_even, #select_odd, #to_s
Constructor Details
#initialize(parser) ⇒ Ignore
Returns a new instance of Ignore.
4 5 6 |
# File 'lib/d-parse/parsers/modifiers/ignore.rb', line 4 def initialize(parser) @parser = parser end |
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/d-parse/parsers/modifiers/ignore.rb', line 12 def inspect "ignore(#{@parser.inspect})" end |
#read(input, pos) ⇒ Object
8 9 10 |
# File 'lib/d-parse/parsers/modifiers/ignore.rb', line 8 def read(input, pos) @parser.read(input, pos).map { |_| nil } end |