Class: NotificationStanza
- Inherits:
-
Object
- Object
- NotificationStanza
- 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
- #feed_url ⇒ Object
- #http_status ⇒ Object
-
#initialize(xml) ⇒ NotificationStanza
constructor
A new instance of NotificationStanza.
- #next_fetch ⇒ Object
Constructor Details
#initialize(xml) ⇒ NotificationStanza
Returns a new instance of NotificationStanza.
52 53 54 |
# File 'lib/stanzas/notification_stanza.rb', line 52 def initialize(xml) parse(xml.to_s) end |
Instance Method Details
#feed_url ⇒ Object
64 65 66 |
# File 'lib/stanzas/notification_stanza.rb', line 64 def feed_url CGI.unescape(@feed_url).gsub("\n", "") end |
#http_status ⇒ Object
60 61 62 |
# File 'lib/stanzas/notification_stanza.rb', line 60 def http_status @http_status.to_i end |
#next_fetch ⇒ Object
56 57 58 |
# File 'lib/stanzas/notification_stanza.rb', line 56 def next_fetch Time.parse(@next_fetch) end |