Class: Rss2Html::FeedItem

Inherits:
Object
  • Object
show all
Defined in:
lib/rss2html/feed_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ FeedItem

Returns a new instance of FeedItem.



21
22
23
24
25
26
27
# File 'lib/rss2html/feed_item.rb', line 21

def initialize(item)
  @title = item.title.content
  @author = item.author.name.content
  @date = item.updated.content
  @summary = item.summary.content.strip
  @url = URI.parse(item.link.href)
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



19
20
21
# File 'lib/rss2html/feed_item.rb', line 19

def author
  @author
end

#dateObject (readonly)

Returns the value of attribute date.



19
20
21
# File 'lib/rss2html/feed_item.rb', line 19

def date
  @date
end

#summaryObject (readonly)

Returns the value of attribute summary.



19
20
21
# File 'lib/rss2html/feed_item.rb', line 19

def summary
  @summary
end

#titleObject (readonly)

Returns the value of attribute title.



19
20
21
# File 'lib/rss2html/feed_item.rb', line 19

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



19
20
21
# File 'lib/rss2html/feed_item.rb', line 19

def url
  @url
end