Class: Sprockets::Export::Template
- Inherits:
-
Object
- Object
- Sprockets::Export::Template
- Defined in:
- lib/sprockets/export/template.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Template
constructor
A new instance of Template.
- #render ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Template
Returns a new instance of Template.
8 9 10 11 12 |
# File 'lib/sprockets/export/template.rb', line 8 def initialize(data = {}) data.each do |key, value| instance_variable_set("@#{key}".to_sym, value) end end |
Class Method Details
Instance Method Details
#render ⇒ Object
14 15 16 |
# File 'lib/sprockets/export/template.rb', line 14 def render ERB.new(self.class.content, nil, "-").result(binding).strip + "\n" end |