Class: FeedAbstract::Channel::RDF
- Defined in:
- lib/feed-abstract/channel/rdf.rb
Instance Method Summary collapse
-
#author ⇒ Object
The authors list as a string, joined with a comma.
-
#authors ⇒ Object
The authors list as an array.
-
#categories ⇒ Object
The category list as an array.
-
#category ⇒ Object
The category list as a string, joined with a comma.
-
#generator ⇒ Object
The generator of this feed.
-
#icon ⇒ Object
(also: #logo)
A URL (with or without domain depending on input) to a icon representing this feed.
- #language ⇒ Object
-
#rights ⇒ Object
Copyright info.
-
#updated ⇒ Object
A Time object representing when this feed was updated, or at least “dated” according to the RDF spec.
Instance Method Details
#author ⇒ Object
The authors list as a string, joined with a comma.
19 20 21 22 |
# File 'lib/feed-abstract/channel/rdf.rb', line 19 def return '' if self..empty? self..join(', ') end |
#authors ⇒ Object
The authors list as an array.
13 14 15 16 |
# File 'lib/feed-abstract/channel/rdf.rb', line 13 def return [] if @feed.channel.dc_publishers.empty? @feed.channel.dc_publishers.collect{|dcp| dcp.content}.reject{|au| au == '' || au.match(/^\s+$/)} end |
#categories ⇒ Object
The category list as an array.
34 35 36 37 |
# File 'lib/feed-abstract/channel/rdf.rb', line 34 def categories return [] if @feed.channel.dc_subjects.empty? @feed.channel.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.
40 41 42 43 |
# File 'lib/feed-abstract/channel/rdf.rb', line 40 def category return '' if self.categories.empty? self.categories.join(', ') end |
#generator ⇒ Object
The generator of this feed.
25 26 27 28 29 30 31 |
# File 'lib/feed-abstract/channel/rdf.rb', line 25 def generator return '' unless @feed.channel.respond_to?(:about) if @feed.channel.about.match(/connotea/i) return 'Connotea' end '' end |
#icon ⇒ Object Also known as: logo
A URL (with or without domain depending on input) to a icon representing this feed.
46 47 48 49 |
# File 'lib/feed-abstract/channel/rdf.rb', line 46 def icon return '' if @feed.channel.image.nil? @feed.channel.image.resource end |
#language ⇒ Object
7 8 9 10 |
# File 'lib/feed-abstract/channel/rdf.rb', line 7 def language return '' if @feed.channel.dc_language.nil? @feed.channel.dc_language end |
#rights ⇒ Object
Copyright info.
53 54 55 56 |
# File 'lib/feed-abstract/channel/rdf.rb', line 53 def rights return '' if @feed.channel.dc_rights.nil? @feed.channel.dc_rights end |
#updated ⇒ Object
A Time object representing when this feed was updated, or at least “dated” according to the RDF spec.
59 60 61 62 |
# File 'lib/feed-abstract/channel/rdf.rb', line 59 def updated return '' if @feed.channel.dc_date.nil? @feed.channel.dc_date end |