Class: ComicFeed::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

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

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end

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

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

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