Class: NetObserver::LastRequest
- Inherits:
-
Object
- Object
- NetObserver::LastRequest
- Includes:
- Singleton
- Defined in:
- lib/net_observer/last_request.rb
Overview
NetObserver::Logger.new Logger.new STDOUT
Instance Attribute Summary collapse
-
#last_request ⇒ Object
readonly
Returns the value of attribute last_request.
Instance Method Summary collapse
- #disable ⇒ Object
-
#enable ⇒ Object
@param(Logger) logger which recieve informations about communication.
- #update(type, request, body, connection) ⇒ Object
Instance Attribute Details
#last_request ⇒ Object (readonly)
Returns the value of attribute last_request.
13 14 15 |
# File 'lib/net_observer/last_request.rb', line 13 def last_request @last_request end |
Instance Method Details
#disable ⇒ Object
21 22 23 24 |
# File 'lib/net_observer/last_request.rb', line 21 def disable @last_request = nil Base.instance.delete_observer(self) end |
#enable ⇒ Object
@param(Logger) logger which recieve informations about communication
16 17 18 19 |
# File 'lib/net_observer/last_request.rb', line 16 def enable @last_request = nil Base.instance.add_observer(self) end |
#update(type, request, body, connection) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/net_observer/last_request.rb', line 27 def update(type, request, body, connection) case type when :response return #don't care when :request @last_request = { :connection => connection, :request => request, :body => (request.body || body)} end end |