Class: RSS2Mail::RSS::Item
- Inherits:
-
Object
- Object
- RSS2Mail::RSS::Item
- Defined in:
- lib/rss2mail/rss.rb
Instance Method Summary collapse
- #author ⇒ Object
- #body(tag = nil, encoding = nil) ⇒ Object
- #date ⇒ Object
- #description(unescape_html = false) ⇒ Object
-
#initialize(item) ⇒ Item
constructor
A new instance of Item.
- #link ⇒ Object
- #subject ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(item) ⇒ Item
Returns a new instance of Item.
84 85 86 |
# File 'lib/rss2mail/rss.rb', line 84 def initialize(item) @item = item end |
Instance Method Details
#author ⇒ Object
106 107 108 |
# File 'lib/rss2mail/rss.rb', line 106 def @author ||= value_for({ :author => %w[contributor dc_creator] }, %w[name content]) end |
#body(tag = nil, encoding = nil) ⇒ Object
110 111 112 |
# File 'lib/rss2mail/rss.rb', line 110 def body(tag = nil, encoding = nil) @body ||= get_body(tag, encoding) end |
#date ⇒ Object
100 101 102 103 104 |
# File 'lib/rss2mail/rss.rb', line 100 def date @date ||= value_for({ :date => %w[pubDate updated dc_date] }, :content) { |field, value| field == 'updated' && value.respond_to?(:content) ? Time.at(value.content.to_i) : value } end |
#description(unescape_html = false) ⇒ Object
96 97 98 |
# File 'lib/rss2mail/rss.rb', line 96 def description(unescape_html = false) @description ||= get_description(unescape_html) end |
#link ⇒ Object
92 93 94 |
# File 'lib/rss2mail/rss.rb', line 92 def link @link ||= value_for(:link, :href) end |
#subject ⇒ Object
114 115 116 |
# File 'lib/rss2mail/rss.rb', line 114 def subject @subject ||= title ? clean_subject(title) : 'NO TITLE' end |
#title ⇒ Object
88 89 90 |
# File 'lib/rss2mail/rss.rb', line 88 def title @title ||= value_for(:title, :content) end |