Class: NetObserver::Base

Inherits:
Object
  • Object
show all
Includes:
Observable, Singleton
Defined in:
lib/net_observer/base.rb

Overview

See Also:

Instance Method Summary collapse

Instance Method Details

#request_data(connection, request, body) ⇒ Object

internal method for network hook



29
30
31
32
# File 'lib/net_observer/base.rb', line 29

def request_data(connection, request,body)
	changed
	notify_observers(:request,request,body, connection)
end

#response_data(connection, response) ⇒ Object

internal method for network hook



35
36
37
38
39
# File 'lib/net_observer/base.rb', line 35

def response_data(connection, response)
	changed
	body = response.respond_to?(:body) ? response.body : ""
	notify_observers(:response,response,body, connection)
end