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



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

def initialize
  @buffer = []
end

Class Attribute Details

.parser_forObject

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

Parameters:

  • line (String)

Returns:

  • (Boolean)


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

Parameters:

Returns:

  • (nil, Class)


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

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))


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

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

#parsed_contentString

Return parsed content

Returns:

  • (String)


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

def parsed_content
  @buffer.join('')
end