Class: CodelessCode::Formats::Parsers::Base

Inherits:
MediaWikiWalker
  • Object
show all
Defined in:
lib/codeless_code/formats/parsers/base.rb

Overview

An abstract base class for the custom parsers for the syntax tree generated by the MediaCloth gem.

Direct Known Subclasses

Plain, Term

Constant Summary collapse

ABSTRACT_METHODS =

Reimplement these

Examples:

def parse_paragraph(ast)
  parse_wiki_ast(ast)
end
%i[
  parse_paragraph
  parse_paste
  parse_formatted
  parse_list_item
  parse_list_term
  parse_list_definition
  parse_preformatted
  parse_section
  parse_link
  parse_internal_link
  parse_internal_link_item
  parse_table
  parse_table_row
  parse_table_cell
  parse_element
  parse_template
  parse_category
  parse_keyword
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ctx) ⇒ Base

Returns a new instance of Base


55
56
57
# File 'lib/codeless_code/formats/parsers/base.rb', line 55

def initialize(ctx)
  @ctx = ctx
end

Instance Attribute Details

#ctxObject (readonly)

Returns the value of attribute ctx


53
54
55
# File 'lib/codeless_code/formats/parsers/base.rb', line 53

def ctx
  @ctx
end