Class: Quarry::Spec::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/quarry/spec/document.rb

Overview

Document Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, spec, title, css) ⇒ Template

Returns a new instance of Template.



114
115
116
117
118
119
# File 'lib/quarry/spec/document.rb', line 114

def initialize(template, spec, title, css)
  @template = template
  @spec     = spec
  @title    = title
  @css      = css
end

Instance Attribute Details

#cssObject (readonly)

Returns the value of attribute css.



111
112
113
# File 'lib/quarry/spec/document.rb', line 111

def css
  @css
end

#specObject (readonly)

Returns the value of attribute spec.



109
110
111
# File 'lib/quarry/spec/document.rb', line 109

def spec
  @spec
end

#titleObject (readonly)

Returns the value of attribute title.



110
111
112
# File 'lib/quarry/spec/document.rb', line 110

def title
  @title
end

Instance Method Details

#parse_templateObject



121
122
123
124
# File 'lib/quarry/spec/document.rb', line 121

def parse_template
  erb = ERB.new(@template)
  erb.result(binding)
end