Class: Urss::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/urss/feed.rb

Direct Known Subclasses

Atom, Rss

Defined Under Namespace

Classes: Atom, Entry, Rss

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFeed

~~~~ Instance methods ~~~~



9
10
11
12
13
14
15
16
# File 'lib/urss/feed.rb', line 9

def initialize
  self.title = nil
  self.url = nil
  self.description = nil
  self.updated_at = nil
  self.entries = []
  self.author = nil
end

Instance Attribute Details

#authorObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def author
  @author
end

#descriptionObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def description
  @description
end

#entriesObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def entries
  @entries
end

#titleObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def title
  @title
end

#updated_atObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def updated_at
  @updated_at
end

#urlObject

~~~~ Attributes ~~~~



4
5
6
# File 'lib/urss/feed.rb', line 4

def url
  @url
end

Instance Method Details

#finalize!Object



18
19
20
21
# File 'lib/urss/feed.rb', line 18

def finalize!
  # Fill in all entries author field with the Feed#author content when entry author field is empty
  self.entries.each{|entry| entry.author = self.author if entry.author.nil? || entry.author == ""}
end