Class: God::Contacts::Airbrake
- Inherits:
-
God::Contact
- Object
- God::Contact
- God::Contacts::Airbrake
- Defined in:
- lib/god/contacts/airbrake.rb
Class Attribute Summary collapse
-
.apikey ⇒ Object
Returns the value of attribute apikey.
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
Attributes inherited from God::Contact
Instance Method Summary collapse
Methods inherited from God::Contact
#arg, defaults, #friendly_name, generate, normalize, valid?
Methods included from God::Configurable
#base_name, complain, #complain, #friendly_name, #prepare, #reset
Class Attribute Details
.apikey ⇒ Object
Returns the value of attribute apikey.
15 16 17 |
# File 'lib/god/contacts/airbrake.rb', line 15 def apikey @apikey end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
24 25 26 |
# File 'lib/god/contacts/airbrake.rb', line 24 def apikey @apikey end |
Instance Method Details
#notify(message, time, priority, category, host) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/god/contacts/airbrake.rb', line 26 def notify(, time, priority, category, host) ::Airbrake.configure {} = "God: #{.to_s} at #{host}" << " | #{[category, priority].join(" ")}" unless category.to_s.empty? or priority.to_s.empty? if ::Airbrake.notify nil, :error_message => , :api_key => arg(:apikey) self.info = "sent airbrake notification to #{self.name}" else self.info = "failed to send airbrake notification to #{self.name}" end rescue Object => e applog(nil, :info, "failed to send airbrake notification: #{e.}") applog(nil, :debug, e.backtrace.join("\n")) end |
#valid? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/god/contacts/airbrake.rb', line 18 def valid? valid = true valid &= complain("Attribute 'apikey' must be specified", self) if self.apikey.nil? valid end |