class Markaby::Rails::TemplateHandler
Public Class Methods
Source
# File lib/markaby/rails.rb, line 17 def options @options ||= {} end
TODO: Do we need this? Default format used by Markaby
class_attribute :default_format self.default_format = :html
Source
# File lib/markaby/rails.rb, line 21 def options=(val) options.merge!(val) options end
Source
# File lib/markaby/rails.rb, line 7 def register!(options = {}) self.options = options ActionView::Template.register_template_handler(:mab, new) end
Public Instance Methods
Source
# 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