Class: FeedAbstract::Item::RDF
Instance Attribute Summary
Attributes inherited from RSS
Instance Method Summary collapse
-
#author ⇒ Object
The author list as a string, joined with a comma.
-
#authors ⇒ Object
The author list (from the dc:creator element) as an array.
-
#categories ⇒ Object
The category list (parsed from the dc:subject element) as an array.
-
#category ⇒ Object
The category list as a string, joined with a comma.
-
#guid ⇒ Object
A globally unique id, in this case probably a URL.
-
#updated ⇒ Object
(also: #published)
A Time object.
Methods inherited from RSS
#content, #contributor, #contributors, #initialize, #link, #rights, #summary, #title
Constructor Details
This class inherits a constructor from FeedAbstract::Item::RSS
Instance Method Details
#author ⇒ Object
The author list as a string, joined with a comma.
13 14 15 16 |
# File 'lib/feed-abstract/item/rdf.rb', line 13 def return '' if self..empty? self..join(', ') end |
#authors ⇒ Object
The author list (from the dc:creator element) as an array.
8 9 10 |
# File 'lib/feed-abstract/item/rdf.rb', line 8 def (@item.dc_creators.empty?) ? [] : @item.dc_creators.collect{|c| c.content}.reject{|au| au == '' || au.match(/^\s+$/)} end |
#categories ⇒ Object
The category list (parsed from the dc:subject element) as an array.
19 20 21 22 |
# File 'lib/feed-abstract/item/rdf.rb', line 19 def categories return [] if @item.dc_subjects.empty? @item.dc_subjects.collect{|c| c.content}.reject{|c| c == '' || c.match(/^\s+$/)} end |
#category ⇒ Object
The category list as a string, joined with a comma.
25 26 27 28 |
# File 'lib/feed-abstract/item/rdf.rb', line 25 def category return '' if self.categories.empty? self.categories.join(', ') end |
#guid ⇒ Object
A globally unique id, in this case probably a URL.
38 39 40 41 |
# File 'lib/feed-abstract/item/rdf.rb', line 38 def guid return '' if @item.about.nil? @item.about end |
#updated ⇒ Object Also known as: published
A Time object.
31 32 33 34 |
# File 'lib/feed-abstract/item/rdf.rb', line 31 def updated return '' if @item.dc_date.nil? @item.dc_date end |