Class: FeedAbstract::Channel::RDF

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

Instance Attribute Summary

Attributes inherited from RSS

#feed, #source

Instance Method Summary collapse

Methods inherited from RSS

#description, #guid, #initialize, #link, #title

Constructor Details

This class inherits a constructor from FeedAbstract::Channel::RSS

Instance Method Details

#authorObject

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



19
20
21
22
# File 'lib/feed-abstract/channel/rdf.rb', line 19

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

#authorsObject

The authors list as an array.



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

def authors
  return [] if @feed.channel.dc_publishers.empty?
  @feed.channel.dc_publishers.collect{|dcp| dcp.content}.reject{|au| au == '' || au.match(/^\s+$/)}
end

#categoriesObject

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

#categoryObject

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

#generatorObject

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

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

#languageObject



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

#rightsObject

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

#updatedObject

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