Class: GoogleReader::Feed
- Inherits:
-
Object
- Object
- GoogleReader::Feed
- Defined in:
- lib/google_reader/feed.rb
Instance Attribute Summary collapse
-
#feed ⇒ Object
readonly
Returns the value of attribute feed.
Instance Method Summary collapse
- #author ⇒ Object
- #continuation ⇒ Object
- #entries ⇒ Object
- #href ⇒ Object
- #id ⇒ Object
-
#initialize(feed) ⇒ Feed
constructor
A new instance of Feed.
- #title ⇒ Object
- #updated_at ⇒ Object
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
#feed ⇒ Object (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
#author ⇒ Object
35 36 37 |
# File 'lib/google_reader/feed.rb', line 35 def @feed.search("author name").first.text end |
#continuation ⇒ Object
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 |
#entries ⇒ Object
11 12 13 |
# File 'lib/google_reader/feed.rb', line 11 def entries @entries ||= @feed.search("entry").map {|entry| Entry.new(entry, self)} end |
#href ⇒ Object
31 32 33 |
# File 'lib/google_reader/feed.rb', line 31 def href @feed.search("link[rel=self]").first["href"] end |
#id ⇒ Object
15 16 17 |
# File 'lib/google_reader/feed.rb', line 15 def id @feed.search("id").first.text end |
#title ⇒ Object
27 28 29 |
# File 'lib/google_reader/feed.rb', line 27 def title @feed.search("title").first.text end |
#updated_at ⇒ Object
19 20 21 |
# File 'lib/google_reader/feed.rb', line 19 def updated_at Time.parse( @feed.search("updated").first.text ) end |