Class: God::Contacts::Twitter
- Inherits:
-
God::Contact
- Object
- God::Contact
- God::Contacts::Twitter
- Defined in:
- lib/god/contacts/twitter.rb
Class Attribute Summary collapse
-
.settings ⇒ Object
Returns the value of attribute settings.
Attributes inherited from God::Contact
Instance Method Summary collapse
Methods inherited from God::Contact
#friendly_name, generate, normalize, valid?
Methods included from God::Configurable
#base_name, complain, #complain, #friendly_name, #prepare, #reset
Class Attribute Details
.settings ⇒ Object
Returns the value of attribute settings.
20 21 22 |
# File 'lib/god/contacts/twitter.rb', line 20 def settings @settings end |
Instance Method Details
#notify(message, time, priority, category, host) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/god/contacts/twitter.rb', line 27 def notify(, time, priority, category, host) begin ::Twitter::Base.new(Twitter.settings[:username], Twitter.settings[:password]).update() self.info = "sent twitter update as #{Twitter.settings[:username]}" rescue => e self.info = "failed to send twitter update from #{self.twitter_id}: #{e.}" end end |
#valid? ⇒ Boolean
23 24 25 |
# File 'lib/god/contacts/twitter.rb', line 23 def valid? valid = true end |