Class: Flue::ERBFilter
- Inherits:
-
Object
- Object
- Flue::ERBFilter
- Defined in:
- lib/flue/content_filter.rb
Constant Summary
Constants included from Logger
Instance Method Summary collapse
Methods included from Benchmark
Methods included from Logger
Instance Method Details
#call(input, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/flue/content_filter.rb', line 33 def call(input, ={}) if [:variables] [:variables].each do |name,value| instance_variable_set("@#{name.to_s}", value) end end ERB.new(input).result(binding) end |
#partial(name) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/flue/content_filter.rb', line 42 def partial(name) partialfile = PartialFile.new(name) benchmark "#{partialfile.basename} => partial" do call( FilterRegister.run(partialfile.exts, partialfile.content, :partial => true) ) end end |