Class: GoogleReader::Feed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feed) ⇒ Feed

Returns a new instance of Feed.



7
8
9
# File 'lib/google_reader/feed.rb', line 7

def initialize(feed)
  @feed = feed
end

Instance Attribute Details

#feedObject (readonly)

Returns the value of attribute feed.



5
6
7
# File 'lib/google_reader/feed.rb', line 5

def feed
  @feed
end

Instance Method Details

#authorObject



35
36
37
# File 'lib/google_reader/feed.rb', line 35

def author
  @feed.search("author name").first.text
end

#continuationObject



23
24
25
# File 'lib/google_reader/feed.rb', line 23

def continuation
  @feed.search("gr:continuation", "gr" => GoogleReader::GOOGLE_ATOM_NAMESPACE).first.text
end

#entriesObject



11
12
13
# File 'lib/google_reader/feed.rb', line 11

def entries
  @entries ||= @feed.search("entry").map {|entry| Entry.new(entry, self)}
end

#hrefObject



31
32
33
# File 'lib/google_reader/feed.rb', line 31

def href
  @feed.search("link[rel=self]").first["href"]
end

#idObject



15
16
17
# File 'lib/google_reader/feed.rb', line 15

def id
  @feed.search("id").first.text
end

#titleObject



27
28
29
# File 'lib/google_reader/feed.rb', line 27

def title
  @feed.search("title").first.text
end

#updated_atObject



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

def updated_at
  Time.parse( @feed.search("updated").first.text )
end