1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/hamlit/parser.rb
2015-10-25 16:33:52 +09:00

21 lines
382 B
Ruby

require 'haml'
module Hamlit
class Parser
AVAILABLE_OPTIONS = %i[
autoclose
escape_html
].freeze
def initialize(options = {})
@options = Haml::Options.defaults.dup
AVAILABLE_OPTIONS.each do |key|
@options[key] = options[key]
end
end
def call(template)
Haml::Parser.new(template, @options).parse
end
end
end