Class: Lilypad::Hoptoad::Notify

Inherits:
Object
  • Object
show all
Includes:
Log::Methods
Defined in:
lib/lilypad/hoptoad/notify.rb

Defined Under Namespace

Classes: Backtrace

Instance Method Summary collapse

Methods included from Log::Methods

#log

Constructor Details

#initialize(env, exception) ⇒ Notify

Returns a new instance of Notify.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/lilypad/hoptoad/notify.rb', line 7

def initialize(env, exception)
  @exception = exception
  @env = env
  
  http_start do |http|
    begin
      xml = XML.build *parse
      http.post @uri.path, xml, headers
    rescue Exception => e
    end
  end
  
  if env && success?
    env['hoptoad.notified'] = true
  end
  
  Config::Request.reset!
  log :notify, @response
  success?
end