Class: Document
- Inherits:
-
Object
- Object
- Document
- Defined in:
- lib/sambal/test_server.rb
Instance Method Summary collapse
-
#initialize(template) ⇒ Document
constructor
A new instance of Document.
- #interpolate(replacements = {}) ⇒ Object
Constructor Details
#initialize(template) ⇒ Document
Returns a new instance of Document.
14 15 16 |
# File 'lib/sambal/test_server.rb', line 14 def initialize(template) @template = ERB.new(template) end |
Instance Method Details
#interpolate(replacements = {}) ⇒ Object
18 19 20 |
# File 'lib/sambal/test_server.rb', line 18 def interpolate(replacements = {}) @template.result(replacements.to_binding) end |