Class: Dimples::Template
- Inherits:
-
Object
- Object
- Dimples::Template
- Includes:
- Frontable, Renderable
- Defined in:
- lib/dimples/template.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#path ⇒ Object
Returns the value of attribute path.
-
#rendered_contents ⇒ Object
Returns the value of attribute rendered_contents.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(site, path) ⇒ Template
constructor
A new instance of Template.
Methods included from Renderable
#build_scope, #render, #renderer
Methods included from Frontable
#apply_metadata, #read_with_yaml
Constructor Details
#initialize(site, path) ⇒ Template
Returns a new instance of Template.
12 13 14 15 16 17 18 |
# File 'lib/dimples/template.rb', line 12 def initialize(site, path) @site = site @slug = File.basename(path, File.extname(path)) @path = path @contents = read_with_yaml(path) end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
9 10 11 |
# File 'lib/dimples/template.rb', line 9 def contents @contents end |
#path ⇒ Object
Returns the value of attribute path.
8 9 10 |
# File 'lib/dimples/template.rb', line 8 def path @path end |
#rendered_contents ⇒ Object
Returns the value of attribute rendered_contents.
10 11 12 |
# File 'lib/dimples/template.rb', line 10 def rendered_contents @rendered_contents end |
#slug ⇒ Object
Returns the value of attribute slug.
6 7 8 |
# File 'lib/dimples/template.rb', line 6 def slug @slug end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/dimples/template.rb', line 7 def title @title end |