Class: Deface::SlimConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/deface/slim_converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(template, options = {}) ⇒ SlimConverter

Returns a new instance of SlimConverter.



6
7
8
# File 'lib/deface/slim_converter.rb', line 6

def initialize(template, options = {})
  @template = template
end

Instance Method Details

#resultObject



10
11
12
13
# File 'lib/deface/slim_converter.rb', line 10

def result
  conv = defined?(Slim::RailsTemplate) ? rails_converter : generic_converter
  conv.call(@template).gsub(/<%\s*%>/, '')
end