Class: QED::Template

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


271
272
273
274
275
276
# File 'lib/qed/document.rb', line 271

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


268
269
270
# File 'lib/qed/document.rb', line 268

def css
  @css
end

#specObject (readonly)

Returns the value of attribute spec


266
267
268
# File 'lib/qed/document.rb', line 266

def spec
  @spec
end

#titleObject (readonly)

Returns the value of attribute title


267
268
269
# File 'lib/qed/document.rb', line 267

def title
  @title
end

Instance Method Details

#parse_templateObject


278
279
280
281
# File 'lib/qed/document.rb', line 278

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