Method: Timber::Events::HTTPRequest#initialize

Defined in:
lib/timber/events/http_server_request.rb

#initialize(attributes) ⇒ HTTPRequest

Returns a new instance of HTTPRequest.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/timber/events/http_server_request.rb', line 11

def initialize(attributes)
  @host = attributes[:host] || raise(ArgumentError.new(":host is required"))
  @method = attributes[:method] || raise(ArgumentError.new(":method is required"))
  @path = attributes[:path] || raise(ArgumentError.new(":path is required"))
  @port = attributes[:port]
  @query_params = attributes[:query_params]
  @content_type = attributes[:content_type]
  @remote_addr = attributes[:remote_addr]
  @referrer = attributes[:referrer]
  @request_id = attributes[:request_id]
  @user_agent = attributes[:user_agent]
end