class God::Contacts::Airbrake

Attributes

apikey[RW]
apikey[RW]

Public Instance Methods

notify(message, time, priority, category, host) click to toggle source
# File lib/god/contacts/airbrake.rb, line 26
def notify(message, time, priority, category, host)
  ::Airbrake.configure {}

  message = "God: #{message.to_s} at #{host}"
  message << " | #{[category, priority].join(" ")}" unless category.to_s.empty? or priority.to_s.empty?

  if ::Airbrake.notify nil, :error_message => 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.message}")
  applog(nil, :debug, e.backtrace.join("\n"))
end
valid?() click to toggle source
# 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