Module: Ronin::Templates::Erb
- Includes:
- Template
- Defined in:
- lib/ronin/templates/erb.rb
Overview
Instance Method Summary collapse
-
#erb(template) ⇒ String
Renders the inline ERB template in the scope of the object.
-
#erb_file(template_path) ⇒ String
Renders an ERB template file in the scope of the object.
Methods included from Template
#enter_template, #find_template, #read_template, #template_dir, #template_dirs
Instance Method Details
#erb(template) ⇒ String
Renders the inline ERB template in the scope of the object.
52 53 54 |
# File 'lib/ronin/templates/erb.rb', line 52 def erb(template) ERB.new(template).result(binding) end |
#erb_file(template_path) ⇒ String
Renders an ERB template file in the scope of the object.
70 71 72 73 74 |
# File 'lib/ronin/templates/erb.rb', line 70 def erb_file(template_path) read_template(template_path) do |template| erb(template) end end |