Class: SimpleSite::HamlContext

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_site/haml_context.rb

Instance Method Summary collapse

Instance Method Details

#partial(partial_name) ⇒ Object



9
10
11
# File 'lib/simple_site/haml_context.rb', line 9

def partial partial_name
  render_file "_src/_#{partial_name}.haml"
end

#render_file(filename) ⇒ Object



4
5
6
7
# File 'lib/simple_site/haml_context.rb', line 4

def render_file filename
  contents = File.read(filename)
  Haml::Engine.new(contents).render
end