Class: BlogFeed::Item
- Inherits:
-
Object
- Object
- BlogFeed::Item
- Defined in:
- app/models/blog_feed.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#pub_date ⇒ Object
readonly
Returns the value of attribute pub_date.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url_title ⇒ Object
readonly
Returns the value of attribute url_title.
Instance Method Summary collapse
-
#initialize(post) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(post) ⇒ Item
Returns a new instance of Item.
22 23 24 25 26 27 |
# File 'app/models/blog_feed.rb', line 22 def initialize(post) @title = post.title @content = Markdown.render post.content, :html_safe => false, :link_to_absolute => true @url_title = post.url_title @pub_date = post.posted_at.localtime.strftime "%a, %d %b %Y %H:%M:00 %z" end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
20 21 22 |
# File 'app/models/blog_feed.rb', line 20 def content @content end |
#pub_date ⇒ Object (readonly)
Returns the value of attribute pub_date.
20 21 22 |
# File 'app/models/blog_feed.rb', line 20 def pub_date @pub_date end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
20 21 22 |
# File 'app/models/blog_feed.rb', line 20 def title @title end |
#url_title ⇒ Object (readonly)
Returns the value of attribute url_title.
20 21 22 |
# File 'app/models/blog_feed.rb', line 20 def url_title @url_title end |