Class Kotoba_Rss::Feed
In: lib/kotoba_rss/feed.rb
Parent: Object

Methods

get   new  

Public Class methods

[Source]

   # File lib/kotoba_rss/feed.rb, line 7
7:   def initialize
8:     @cache = Kotoba_Rss::Cache.instance
9:   end

Public Instance methods

[Source]

    # File lib/kotoba_rss/feed.rb, line 11
11:   def get(url)
12:     result = nil
13:     if @cache.has_expired?(url)
14:       open(url) do |http|
15:         response = http.read
16:         result   = RSS::Parser.parse(response, false)
17:       end
18:       @cache.add(url,result)
19:     else
20:       result = @cache.get(url)
21:     end
22:     return result
23:   end

[Validate]