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
9 10 11 |
# File 'lib/dimples/post.rb', line 9 def date @metadata.fetch(:date, DateTime.now) end |
#layout ⇒ Object
13 14 15 |
# File 'lib/dimples/post.rb', line 13 def layout @metadata.fetch(:layout, "post") end |
#slug ⇒ Object
17 18 19 |
# File 'lib/dimples/post.rb', line 17 def slug File.basename(@path, ".markdown") end |