class Ant::Server::RequestResponse
Wraps the request and the response into an object so it is easier to track monitoring logs and format the response after the endpoint was executed
Attributes
exception[RW]
params[R]
result[RW]
start_timestamp[RW]
Public Class Methods
new(request:, params:)
click to toggle source
# File lib/ant/server/request_response.rb, line 11 def initialize(request:, params:) @request = request @params = params @start_timestamp = Time.now end
Public Instance Methods
code()
click to toggle source
# File lib/ant/server/request_response.rb, line 21 def code @exception.code end
data()
click to toggle source
# File lib/ant/server/request_response.rb, line 17 def data @exception.data end
ip()
click to toggle source
# File lib/ant/server/request_response.rb, line 29 def ip @request.ip end
message()
click to toggle source
# File lib/ant/server/request_response.rb, line 33 def message @exception.message end
path()
click to toggle source
# File lib/ant/server/request_response.rb, line 37 def path @request.env['PATH_INFO'] end
verb()
click to toggle source
# File lib/ant/server/request_response.rb, line 25 def verb @request.request_method end