Class: Teaspoon::Formatter::RspecHtml::Template

Inherits:
Object
  • Object
show all
Includes:
ERB::Util
Defined in:
lib/teaspoon/formatter/rspec_html.rb

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Template

Returns a new instance of Template.



61
62
63
# File 'lib/teaspoon/formatter/rspec_html.rb', line 61

def initialize(contents)
  @template = contents
end

Instance Method Details

#render(obj) ⇒ Object



65
66
67
68
# File 'lib/teaspoon/formatter/rspec_html.rb', line 65

def render(obj)
  @o = obj
  ERB.new(@template).result binding
end