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

21 lines
376 B
Ruby
Raw Normal View History

2015-10-06 23:14:45 +09:00
require 'haml'
module Hamlit
class Parser
2015-10-11 21:50:46 +09:00
OPTION_MAPS = {
autoclose: :autoclose,
}.freeze
2015-10-06 23:14:45 +09:00
def initialize(options = {})
2015-10-11 21:50:46 +09:00
@options = Haml::Options.defaults.dup
OPTION_MAPS.each do |temple, haml|
@options[haml] = options[temple]
end
2015-10-06 23:14:45 +09:00
end
def call(template)
2015-10-11 21:50:46 +09:00
Haml::Parser.new(template, @options).parse
2015-10-06 23:14:45 +09:00
end
end
end