Class: FeedAbstract::Item::RDF

Inherits:
RSS
  • Object
show all
Defined in:
lib/feed-abstract/item/rdf.rb

Instance Attribute Summary

Attributes inherited from RSS

#channel, #item, #source

Instance Method Summary collapse

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

#authorObject

The author list as a string, joined with a comma.



13
14
15
16
# File 'lib/feed-abstract/item/rdf.rb', line 13

def author
  return '' if self.authors.empty?
  self.authors.join(', ')
end

#authorsObject

The author list (from the dc:creator element) as an array.



8
9
10
# File 'lib/feed-abstract/item/rdf.rb', line 8

def authors
  (@item.dc_creators.empty?) ? [] : @item.dc_creators.collect{|c| c.content}.reject{|au| au == '' || au.match(/^\s+$/)}
end

#categoriesObject

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

#categoryObject

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

#guidObject

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

#updatedObject 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