Class: PointBlank::Parsing::NullParser

Inherits:
Object
  • Object
show all
Defined in:
lib/mmmd/blankshell.rb

Overview

Null parser

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullParser

Instantiate a new parser object



321
322
323
# File 'lib/mmmd/blankshell.rb', line 321

def initialize
  @buffer = []
end

Class Attribute Details

.parser_forObject

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

Parameters:

  • line (String)

Returns:

  • (Boolean)


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

Parameters:

Returns:

  • (nil, Class)


328
329
330
331
332
333
334
335
# File 'lib/mmmd/blankshell.rb', line 328

def close(block, lazy: false)
  block.class.valid_overlays.each do |overlay_class|
    overlay = overlay_class.new
    output = overlay.process(block, lazy: lazy)
    return output if output
  end
  nil
end

#consume(line, _parent = nil, **_hargs) ⇒ Array(String, Boolean)

Consume line markers

Parameters:

  • line (String)

Returns:

  • (Array(String, Boolean))


346
347
348
# File 'lib/mmmd/blankshell.rb', line 346

def consume(line, _parent = nil, **_hargs)
  [line, false]
end

#parsed_contentString

Return parsed content

Returns:

  • (String)


339
340
341
# File 'lib/mmmd/blankshell.rb', line 339

def parsed_content
  @buffer.join('')
end