Class: Markaby::Rails::TemplateHandler
- Inherits:
-
Object
- Object
- Markaby::Rails::TemplateHandler
- Defined in:
- lib/markaby/rails.rb
Class Method Summary collapse
-
.options ⇒ Object
TODO: Do we need this? Default format used by Markaby class_attribute :default_format self.default_format = :html.
- .options=(val) ⇒ Object
- .register!(options = {}) ⇒ Object
Instance Method Summary collapse
Class Method Details
.options ⇒ Object
TODO: Do we need this? Default format used by Markaby class_attribute :default_format self.default_format = :html
17 18 19 |
# File 'lib/markaby/rails.rb', line 17 def @options ||= {} end |
.options=(val) ⇒ Object
21 22 23 24 |
# File 'lib/markaby/rails.rb', line 21 def (val) .merge!(val) end |
.register!(options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/markaby/rails.rb', line 7 def register!( = {}) self. = ActionView::Template.register_template_handler(:mab, new) end |
Instance Method Details
#call(template, source = template.source) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/markaby/rails.rb', line 27 def call(template, source = template.source) <<-CODE Markaby::Builder.new(Markaby::Rails::TemplateHandler.options, self) do #{source} end.to_s CODE end |