Module: Templatable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/templatable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#initialize(materials) ⇒ Object
23 24 25 |
# File 'lib/templatable.rb', line 23 def initialize(materials) @materials = materials end |
#result ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/templatable.rb', line 27 def result placeholders = get_placeholders placeholders.each do |key, value| placeholders[key] = method("manufactured_#{value}").call end ERB.new(get_template).result(binding) end |