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) options.merge!(val) 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, source = template.source)
click to toggle 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