Class: DaimonMarkdown::Processor
- Inherits:
-
Object
- Object
- DaimonMarkdown::Processor
- Defined in:
- lib/daimon_markdown/processor.rb
Constant Summary collapse
- DEFAULT_FILTERS =
[ DaimonMarkdown::Filter::Redcarpet, DaimonMarkdown::Filter::Plugin ]
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #call(input, context = {}) ⇒ Object
- #filters ⇒ Object
-
#initialize(context = {}) ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize(context = {}) ⇒ Processor
Returns a new instance of Processor.
16 17 18 |
# File 'lib/daimon_markdown/processor.rb', line 16 def initialize(context = {}) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
14 15 16 |
# File 'lib/daimon_markdown/processor.rb', line 14 def context @context end |
Instance Method Details
#call(input, context = {}) ⇒ Object
20 21 22 |
# File 'lib/daimon_markdown/processor.rb', line 20 def call(input, context = {}) HTML::Pipeline.new(filters, @context).call(input, context) end |
#filters ⇒ Object
24 25 26 |
# File 'lib/daimon_markdown/processor.rb', line 24 def filters @filters ||= DEFAULT_FILTERS.clone end |