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
321 322 323 |
# File 'lib/mmmd/blankshell.rb', line 321 def initialize @buffer = [] end |
Class Attribute Details
.parser_for ⇒ Object
Returns the value of attribute parser_for.
310 311 312 |
# File 'lib/mmmd/blankshell.rb', line 310 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
315 316 317 |
# File 'lib/mmmd/blankshell.rb', line 315 def begin?(_line) false end |
Instance Method Details
#close(block, lazy: false) ⇒ nil, Class
Close parser
328 329 330 331 332 333 334 335 |
# File 'lib/mmmd/blankshell.rb', line 328 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
346 347 348 |
# File 'lib/mmmd/blankshell.rb', line 346 def consume(line, _parent = nil, **_hargs) [line, false] end |
#parsed_content ⇒ String
Return parsed content
339 340 341 |
# File 'lib/mmmd/blankshell.rb', line 339 def parsed_content @buffer.join('') end |