Class: Ant::Server::RequestResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ant/server/request_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#exceptionObject

Returns the value of attribute exception.



4
5
6
# File 'lib/ant/server/request_response.rb', line 4

def exception
  @exception
end

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/ant/server/request_response.rb', line 4

def params
  @params
end

#resultObject

Returns the value of attribute result.



4
5
6
# File 'lib/ant/server/request_response.rb', line 4

def result
  @result
end

#start_timestampObject

Returns the value of attribute start_timestamp.



4
5
6
# File 'lib/ant/server/request_response.rb', line 4

def start_timestamp
  @start_timestamp
end

Instance Method Details

#codeObject



16
17
18
# File 'lib/ant/server/request_response.rb', line 16

def code
  @exception.code
end

#dataObject



12
13
14
# File 'lib/ant/server/request_response.rb', line 12

def data
  @exception.data
end

#ipObject



24
25
26
# File 'lib/ant/server/request_response.rb', line 24

def ip
  @request.ip
end

#messageObject



28
29
30
# File 'lib/ant/server/request_response.rb', line 28

def message
  @exception.message
end

#pathObject



32
33
34
# File 'lib/ant/server/request_response.rb', line 32

def path
  @request.env['PATH_INFO']
end

#verbObject



20
21
22
# File 'lib/ant/server/request_response.rb', line 20

def verb
  @request.request_method
end