Class: Dimples::Post
Instance Attribute Summary
Attributes inherited from Document
#contents, #metadata, #path, #rendered_contents
Instance Method Summary collapse
Methods inherited from Document
#basename, #extension, #filename, #initialize, #render
Constructor Details
This class inherits a constructor from Dimples::Document
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dimples::Document
Instance Method Details
#date ⇒ Object
7 8 9 |
# File 'lib/dimples/post.rb', line 7 def date @metadata.fetch(:date, DateTime.now) end |
#layout ⇒ Object
11 12 13 |
# File 'lib/dimples/post.rb', line 11 def layout @metadata.fetch(:layout, 'post') end |
#slug ⇒ Object
15 16 17 |
# File 'lib/dimples/post.rb', line 15 def slug File.basename(@path, '.markdown') end |