Class: NotificationStanza

Inherits:
Object
  • Object
show all
Includes:
SAXMachine
Defined in:
lib/stanzas/notification_stanza.rb

Overview

Notification : sent every time a feed has been fetched. It has the following methods:

  • message_status : a simple message that gives information about the last fetch

  • http_status : status of the http response

  • feed_url : url of the feed

  • next_fetch : Time when the feed will be fetched again (this is purely informative and it might change)

  • items : array of new items detected (might be empty)

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ NotificationStanza



47
48
49
# File 'lib/stanzas/notification_stanza.rb', line 47

def initialize(xml)
  parse(xml.to_s)
end

Instance Method Details

#http_statusObject



55
56
57
# File 'lib/stanzas/notification_stanza.rb', line 55

def http_status
  @http_status.to_i
end

#next_fetchObject



51
52
53
# File 'lib/stanzas/notification_stanza.rb', line 51

def next_fetch
  Time.parse(@next_fetch)
end