Parent

Methods

Files

Class/Module Index [+]

Quicksearch

God::Contacts::Campfire

Attributes

format[RW]
room[RW]
ssl[RW]
subdomain[RW]
token[RW]
room[RW]
ssl[RW]
subdomain[RW]
token[RW]

Public Instance Methods

notify(message, time, priority, category, host) click to toggle source
# File lib/god/contacts/campfire.rb, line 102
def notify(message, time, priority, category, host)
  body = Campfire.format.call(message, time, priority, category, host)

  conn = Marshmallow::Connection.new(
    :subdomain => arg(:subdomain),
    :token => arg(:token),
    :ssl => arg(:ssl)
  )

  conn.speak(arg(:room), body)

  self.info = "notified campfire: #{arg(:subdomain)}"
rescue Object => e
  applog(nil, :info, "failed to notify campfire: #{e.message}")
  applog(nil, :debug, e.backtrace.join("\n"))
end
valid?() click to toggle source
# File lib/god/contacts/campfire.rb, line 94
def valid?
  valid = true
  valid &= complain("Attribute 'subdomain' must be specified", self) unless arg(:subdomain)
  valid &= complain("Attribute 'token' must be specified", self) unless arg(:token)
  valid &= complain("Attribute 'room' must be specified", self) unless arg(:room)
  valid
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.