class Markaby::Rails::TemplateHandler
Public Class Methods
options()
click to toggle source
TODO: Do we need this? Default format used by Markaby
class_attribute :default_format self.default_format = :html
# File lib/markaby/rails.rb, line 17 def options @options ||= {} end
options=(val)
click to toggle source
# File lib/markaby/rails.rb, line 21 def options=(val) self.options.merge!(val) self.options end
register!(options={})
click to toggle 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
call(template)
click to toggle source
# File lib/markaby/rails.rb, line 27 def call(template) <<-CODE Markaby::Builder.new(Markaby::Rails::TemplateHandler.options, self) do #{template.source} end.to_s CODE end