Module: Lunetas::Candy::TemplateParsing::InstanceMethods

Defined in:
lib/lunetas/candy/template_parsing.rb

Instance Method Summary collapse

Instance Method Details

#erb(filename) ⇒ String

Parses the given file, located in templates/.erb.

Parameters:

  • filename

    the file located in the templates directory.

Returns:

  • (String)

    the erb parsed template.



6
7
8
9
# File 'lib/lunetas/candy/template_parsing.rb', line 6

def erb(filename)
  file = File.expand_path("templates/#{filename}.erb")
  ERB.new(File.read(file)).result(get_binding)
end