Class: Rack::ProcessERB
- Inherits:
-
Object
- Object
- Rack::ProcessERB
- Defined in:
- lib/rack-denyie.rb
Instance Method Summary collapse
- #bound ⇒ Object
-
#initialize(options = {}) ⇒ ProcessERB
constructor
A new instance of ProcessERB.
Constructor Details
#initialize(options = {}) ⇒ ProcessERB
Returns a new instance of ProcessERB.
71 72 73 74 |
# File 'lib/rack-denyie.rb', line 71 def initialize( = {}) @options = @erb = ERB.new(::File.read(@options[:template]), nil, "%<>") end |
Instance Method Details
#bound ⇒ Object
76 77 78 79 80 |
# File 'lib/rack-denyie.rb', line 76 def bound binding = TemplateVars.new(@options).get_binding # Variables passed to ERB template @template = @erb.result(binding) @template.gsub(/\n$/,'') end |