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-24 20:32:21 +09:00

20 lines
376 B
Ruby

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