Class: Blogue::KramdownTemplateHandler
- Inherits:
-
Object
- Object
- Blogue::KramdownTemplateHandler
- Defined in:
- lib/blogue/kramdown_template_handler.rb
Instance Attribute Summary collapse
-
#preprocessor ⇒ Object
writeonly
Sets the attribute preprocessor.
Instance Method Summary collapse
- #call(template) ⇒ Object
-
#initialize(options = {}) ⇒ KramdownTemplateHandler
constructor
A new instance of KramdownTemplateHandler.
Constructor Details
#initialize(options = {}) ⇒ KramdownTemplateHandler
Returns a new instance of KramdownTemplateHandler.
5 6 7 |
# File 'lib/blogue/kramdown_template_handler.rb', line 5 def initialize( = {}) @options = end |
Instance Attribute Details
#preprocessor=(value) ⇒ Object (writeonly)
Sets the attribute preprocessor
3 4 5 |
# File 'lib/blogue/kramdown_template_handler.rb', line 3 def preprocessor=(value) @preprocessor = value end |
Instance Method Details
#call(template) ⇒ Object
9 10 11 12 13 |
# File 'lib/blogue/kramdown_template_handler.rb', line 9 def call(template) @preprocessor.call(template) if @preprocessor.respond_to?(:call) mdown = ActionView::Template.registered_template_handler(:erb).(template) "Kramdown::Document.new(begin;#{mdown};end, #{@options.inspect}).to_html" end |