Class: PointBlank::Parsing::NullParser
- Inherits:
-
Object
- Object
- PointBlank::Parsing::NullParser
- Defined in:
- lib/mmmd/blankshell.rb
Overview
Null parser
Direct Known Subclasses
ATXParser, FencedCodeBlock, IndentedBlock, NullOverlay, OLElementParser, OLParser, ParagraphParser, QuoteParser, ThematicBreakParser, ULElementParser, ULParser, UnderlineParser
Class Attribute Summary collapse
-
.parser_for ⇒ Object
Returns the value of attribute parser_for.
Class Method Summary collapse
-
.begin?(_line) ⇒ Boolean
Check that a parser parses this line as a beginning of a block.
Instance Method Summary collapse
-
#close(block, lazy: false) ⇒ nil, Class
Close parser.
-
#consume(line, _parent = nil, **_hargs) ⇒ Array(String, Boolean)
Consume line markers.
-
#initialize ⇒ NullParser
constructor
Instantiate a new parser object.
-
#parsed_content ⇒ String
Return parsed content.
Constructor Details
#initialize ⇒ NullParser
Instantiate a new parser object
322 323 324 |
# File 'lib/mmmd/blankshell.rb', line 322 def initialize @buffer = [] end |
Class Attribute Details
.parser_for ⇒ Object
Returns the value of attribute parser_for.
311 312 313 |
# File 'lib/mmmd/blankshell.rb', line 311 def parser_for @parser_for end |
Class Method Details
.begin?(_line) ⇒ Boolean
Check that a parser parses this line as a beginning of a block
316 317 318 |
# File 'lib/mmmd/blankshell.rb', line 316 def begin?(_line) false end |
Instance Method Details
#close(block, lazy: false) ⇒ nil, Class
Close parser
329 330 331 332 333 334 335 336 |
# File 'lib/mmmd/blankshell.rb', line 329 def close(block, lazy: false) block.class..each do || = .new output = .process(block, lazy: lazy) return output if output end nil end |
#consume(line, _parent = nil, **_hargs) ⇒ Array(String, Boolean)
Consume line markers
347 348 349 |
# File 'lib/mmmd/blankshell.rb', line 347 def consume(line, _parent = nil, **_hargs) [line, false] end |
#parsed_content ⇒ String
Return parsed content
340 341 342 |
# File 'lib/mmmd/blankshell.rb', line 340 def parsed_content @buffer.join('') end |