Class: Mbrao::Parser

Inherits:
Object
  • Object
show all
Includes:
PublicInterface, Validations
Defined in:
lib/mbrao/parser.rb

Overview

A parser to handle pipelined content.

Instance Method Summary collapse

Instance Method Details

#parse(content, options = {}) ⇒ Content

Parses a source text.


173
174
175
176
# File 'lib/mbrao/parser.rb', line 173

def parse(content, options = {})
  options = sanitize_parsing_options(options)
  ::Mbrao::Parser.create_engine(options[:engine]).parse(content, options)
end

#render(content, options = {}, context = {}) ⇒ String

Renders a content.


184
185
186
187
# File 'lib/mbrao/parser.rb', line 184

def render(content, options = {}, context = {})
  options = sanitize_rendering_options(options)
  ::Mbrao::Parser.create_engine(options[:engine], :rendering).render(content, options, context)
end