Class: Quarry::Template

Inherits:
Object show all
Defined in:
lib/quarry/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.



112
113
114
115
116
117
# File 'lib/quarry/document.rb', line 112

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.



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

def css
  @css
end

#specObject (readonly)

Returns the value of attribute spec.



107
108
109
# File 'lib/quarry/document.rb', line 107

def spec
  @spec
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#parse_templateObject



119
120
121
122
# File 'lib/quarry/document.rb', line 119

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