Class: Document

Inherits:
Object
  • Object
show all
Defined in:
lib/sambal/test_server.rb

Instance Method Summary collapse

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