Class: Sinatra::HacketySling::Post
- Inherits:
-
Object
- Object
- Sinatra::HacketySling::Post
- Includes:
- DocumentMapper::Document
- Defined in:
- lib/sinatra/hackety_sling/post.rb
Instance Method Summary collapse
Instance Method Details
#date_permalink ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/sinatra/hackety_sling/post.rb', line 17 def date_permalink '/' + ([ sprintf("%04d", self.date.year), sprintf("%02d", self.date.month), sprintf("%02d", self.date.day) ].join '/') + '/' end |
#permalink ⇒ Object
10 11 12 13 14 15 |
# File 'lib/sinatra/hackety_sling/post.rb', line 10 def permalink [ self.date_permalink, self.file_name_without_extension.sub(/^\d{4}-\d{2}-\d{2}-/, '') ].join('') + '/' end |