Class: ComicFeed::Item
- Inherits:
-
Object
- Object
- ComicFeed::Item
- Defined in:
- app/models/comic_feed.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#img_url ⇒ Object
readonly
Returns the value of attribute img_url.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#pub_date ⇒ Object
readonly
Returns the value of attribute pub_date.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#title_text ⇒ Object
readonly
Returns the value of attribute title_text.
Instance Method Summary collapse
-
#initialize(comic) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(comic) ⇒ Item
Returns a new instance of Item.
22 23 24 25 26 27 28 29 |
# File 'app/models/comic_feed.rb', line 22 def initialize(comic) @number = comic.number @title = comic.title @img_url = comic.absolute_img_url @title_text = comic.title_text @description = Markdown.render comic.description, :link_to_absolute => true @pub_date = comic.posted_at.to_time.strftime "%a, %d %b %Y 00:00:01 %z" end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
20 21 22 |
# File 'app/models/comic_feed.rb', line 20 def description @description end |
#img_url ⇒ Object (readonly)
Returns the value of attribute img_url.
20 21 22 |
# File 'app/models/comic_feed.rb', line 20 def img_url @img_url end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
20 21 22 |
# File 'app/models/comic_feed.rb', line 20 def number @number end |
#pub_date ⇒ Object (readonly)
Returns the value of attribute pub_date.
20 21 22 |
# File 'app/models/comic_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/comic_feed.rb', line 20 def title @title end |
#title_text ⇒ Object (readonly)
Returns the value of attribute title_text.
20 21 22 |
# File 'app/models/comic_feed.rb', line 20 def title_text @title_text end |