Class: SemiStatic::News
Instance Attribute Summary collapse
-
#published_at ⇒ Object
Returns the value of attribute published_at.
Attributes inherited from Page
Class Method Summary collapse
Instance Method Summary collapse
-
#id ⇒ Object
used for atom feed.
- #to_param ⇒ Object
Methods inherited from Page
find, first, #initialize, #persisted?, #render, #to_s
Constructor Details
This class inherits a constructor from SemiStatic::Page
Instance Attribute Details
#published_at ⇒ Object
Returns the value of attribute published_at.
4 5 6 |
# File 'lib/semi_static/news.rb', line 4 def published_at @published_at end |
Class Method Details
.all ⇒ Object
7 8 9 |
# File 'lib/semi_static/news.rb', line 7 def self.all super.sort_by(&:published_at).reverse end |
Instance Method Details
#id ⇒ Object
used for atom feed
12 13 14 |
# File 'lib/semi_static/news.rb', line 12 def id Digest::MD5.hexdigest to_param end |
#to_param ⇒ Object
16 17 18 |
# File 'lib/semi_static/news.rb', line 16 def to_param "#{year}/#{month}/#{day}/#{super}" end |