Class Index [+]

Quicksearch

TwitterAlert::Alert

Mix this in to a class you want to represent the messages you’ll DM out.

Attributes

text[R]

The text to be DMed out.

date[R]

The date it should be DMed out.

failed_announcements[R]

An array of hashes containing the id and error text of any DMs that didn’t work.

Public Class Methods

new(text, date) click to toggle source

Text will have to_s called on it. Date will have # and then fed to DateTime.parse

    # File lib/twitter_alert/alert.rb, line 16
16:     def initialize text, date
17:       @text = text.to_s
18:       @date = DateTime.parse(date.to_s)
19:       @failed_announcements = []
20:     end

Public Instance Methods

add_failed_announcement(follower_id, error_text) click to toggle source

Stores a failed announcement so that you can see who and why the failure occured.

    # File lib/twitter_alert/alert.rb, line 33
33:     def add_failed_announcement follower_id, error_text
34:       @failed_announcements << { :follower_id => follower_id, :error_text => error_text }
35:     end
mark_sent() click to toggle source

Marks this message as sent unless there are stored failed announcements.

    # File lib/twitter_alert/alert.rb, line 28
28:     def mark_sent
29:       @sent = @failed_announcements.empty?
30:     end
sent?() click to toggle source

Returns boolean based on whether this messages was successfully sent to all followers or not.

    # File lib/twitter_alert/alert.rb, line 23
23:     def sent?
24:       @sent
25:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.