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.
70 71 72 73 74 75 76 |
# File 'lib/rack-denyie.rb', line 70 def initialize( = {}) @options = @options.each_pair do |key, value| self.instance_variable_set("@#{key}", value) end @erb = ERB.new(::File.read(@options[:template]), nil, "%<>") end |
Instance Method Details
#bound ⇒ Object
78 79 80 81 |
# File 'lib/rack-denyie.rb', line 78 def bound @template = @erb.result(binding) @template.gsub(/\n$/,'') end |