Module: Nesta::Overrides::Renderers

Defined in:
lib/nesta/overrides.rb

Instance Method Summary collapse

Instance Method Details

#erb(template, options = {}, locals = {}) ⇒ Object



9
10
11
12
# File 'lib/nesta/overrides.rb', line 9

def erb(template, options = {}, locals = {})
  defaults, engine = Overrides.render_options(template, :erb)
  super(template, defaults.merge(options), locals)
end

#haml(template, options = {}, locals = {}) ⇒ Object



4
5
6
7
# File 'lib/nesta/overrides.rb', line 4

def haml(template, options = {}, locals = {})
  defaults, engine = Overrides.render_options(template, :haml)
  super(template, defaults.merge(options), locals)
end

#sass(template, options = {}, locals = {}) ⇒ Object



19
20
21
22
# File 'lib/nesta/overrides.rb', line 19

def sass(template, options = {}, locals = {})
  defaults, engine = Overrides.render_options(template, :sass)
  super(template, defaults.merge(options), locals)
end

#scss(template, options = {}, locals = {}) ⇒ Object



14
15
16
17
# File 'lib/nesta/overrides.rb', line 14

def scss(template, options = {}, locals = {})
  defaults, engine = Overrides.render_options(template, :scss)
  super(template, defaults.merge(options), locals)
end

#stylesheet(template, options = {}, locals = {}) ⇒ Object



24
25
26
27
28
# File 'lib/nesta/overrides.rb', line 24

def stylesheet(template, options = {}, locals = {})
  defaults, engine = Overrides.render_options(template, :sass, :scss)
  renderer = Sinatra::Templates.instance_method(engine)
  renderer.bind(self).call(template, defaults.merge(options), locals)
end