Class: BlogFeed::Item

Inherits:
Object
  • Object
show all
Defined in:
app/models/blog_feed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



20
21
22
# File 'app/models/blog_feed.rb', line 20

def content
  @content
end

#pub_dateObject (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

#titleObject (readonly)

Returns the value of attribute title.



20
21
22
# File 'app/models/blog_feed.rb', line 20

def title
  @title
end

#url_titleObject (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