Class: FeedAbstract::Channel::Atom
- Inherits:
-
Object
- Object
- FeedAbstract::Channel::Atom
- Includes:
- FeedAbstractMixins::Atom
- Defined in:
- lib/feed-abstract/channel/atom.rb
Overview
See FeedAbstractMixins::Atom for more instance methods.
Instance Attribute Summary collapse
-
#feed ⇒ Object
readonly
Returns the value of attribute feed.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #description ⇒ Object (also: #subtitle)
-
#generator ⇒ Object
A string representing the application that created this feed.
-
#icon ⇒ Object
A URL (perhaps with domain, depending on input) representing an icon for the feed.
-
#initialize(feed) ⇒ Atom
constructor
A new instance of Atom.
- #language ⇒ Object
-
#logo ⇒ Object
A URL (perhaps with domain, depending on input) representing a logo for the feed.
Methods included from FeedAbstractMixins::Atom
#author, #authors, #categories, #category, #guid, #link, #rights, #title, #updated
Constructor Details
#initialize(feed) ⇒ Atom
Returns a new instance of Atom.
14 15 16 |
# File 'lib/feed-abstract/channel/atom.rb', line 14 def initialize(feed) @feed = @source = feed end |
Instance Attribute Details
#feed ⇒ Object (readonly)
Returns the value of attribute feed.
12 13 14 |
# File 'lib/feed-abstract/channel/atom.rb', line 12 def feed @feed end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/feed-abstract/channel/atom.rb', line 12 def source @source end |
Instance Method Details
#description ⇒ Object Also known as: subtitle
23 24 25 26 |
# File 'lib/feed-abstract/channel/atom.rb', line 23 def description return '' if @feed.subtitle.nil? && @feed.tagline.nil? (@feed.subtitle.nil?) ? @feed.tagline.content : @feed.subtitle.content end |
#generator ⇒ Object
A string representing the application that created this feed.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/feed-abstract/channel/atom.rb', line 30 def generator unless self.link.nil? if self.link.match(/zotero\.org/) return 'Zotero' elsif self.link.match(/wordpress\.com/) return 'WordPress' elsif self.link.match(/https?:\/\/.*\.?twitter\.com/i) return 'Twitter' end end return '' if @feed.generator.nil? @feed.generator.content end |
#icon ⇒ Object
A URL (perhaps with domain, depending on input) representing an icon for the feed.
45 46 47 48 |
# File 'lib/feed-abstract/channel/atom.rb', line 45 def icon return '' if @feed.icon.nil? @feed.icon.content end |
#language ⇒ Object
18 19 20 21 |
# File 'lib/feed-abstract/channel/atom.rb', line 18 def language return '' if @feed.lang.nil? @feed.lang end |
#logo ⇒ Object
A URL (perhaps with domain, depending on input) representing a logo for the feed.
51 52 53 54 |
# File 'lib/feed-abstract/channel/atom.rb', line 51 def logo return '' if @feed.logo.nil? @feed.logo.content end |