Class: Ant::Server::RequestResponse
- Inherits:
-
Object
- Object
- Ant::Server::RequestResponse
- Defined in:
- lib/ant/server/request_response.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
Returns the value of attribute exception.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#result ⇒ Object
Returns the value of attribute result.
-
#start_timestamp ⇒ Object
Returns the value of attribute start_timestamp.
Instance Method Summary collapse
- #code ⇒ Object
- #data ⇒ Object
-
#initialize(request:, params:) ⇒ RequestResponse
constructor
A new instance of RequestResponse.
- #ip ⇒ Object
- #message ⇒ Object
- #path ⇒ Object
- #verb ⇒ Object
Constructor Details
#initialize(request:, params:) ⇒ RequestResponse
Returns a new instance of RequestResponse.
6 7 8 9 10 |
# File 'lib/ant/server/request_response.rb', line 6 def initialize(request:, params:) @request = request @params = params @start_timestamp = Time.now end |
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
4 5 6 |
# File 'lib/ant/server/request_response.rb', line 4 def exception @exception end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/ant/server/request_response.rb', line 4 def params @params end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/ant/server/request_response.rb', line 4 def result @result end |
#start_timestamp ⇒ Object
Returns the value of attribute start_timestamp.
4 5 6 |
# File 'lib/ant/server/request_response.rb', line 4 def @start_timestamp end |
Instance Method Details
#code ⇒ Object
16 17 18 |
# File 'lib/ant/server/request_response.rb', line 16 def code @exception.code end |
#data ⇒ Object
12 13 14 |
# File 'lib/ant/server/request_response.rb', line 12 def data @exception.data end |
#ip ⇒ Object
24 25 26 |
# File 'lib/ant/server/request_response.rb', line 24 def ip @request.ip end |
#message ⇒ Object
28 29 30 |
# File 'lib/ant/server/request_response.rb', line 28 def @exception. end |
#path ⇒ Object
32 33 34 |
# File 'lib/ant/server/request_response.rb', line 32 def path @request.env['PATH_INFO'] end |
#verb ⇒ Object
20 21 22 |
# File 'lib/ant/server/request_response.rb', line 20 def verb @request.request_method end |