Class: Carpetbomb::Handler
- Inherits:
-
Object
- Object
- Carpetbomb::Handler
- Defined in:
- lib/carpetbomb/engine.rb
Instance Method Summary collapse
- #call(template) ⇒ Object
-
#initialize ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize ⇒ Handler
Returns a new instance of Handler.
15 16 |
# File 'lib/carpetbomb/engine.rb', line 15 def initialize end |
Instance Method Details
#call(template) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/carpetbomb/engine.rb', line 18 def call(template) # If the template has any erb tags in it, they will be parsed first. # then with the result we call redcarpet to parse the markdown template. erb = ActionView::Template.registered_template_handler(:erb) source = erb.call(template) <<-SOURCE Carpetbomb.renderer.call(begin;#{source};end).html_safe SOURCE end |