Class: NuHttp::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/nuhttp/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method:, path:, query:, headers: {}, body:) ⇒ Request

Returns a new instance of Request.



77
78
79
80
81
82
83
84
85
86
# File 'lib/nuhttp/context.rb', line 77

def initialize(method:, path:, query:, headers: {}, body:)
  @method = method
  @path = path
  @query = query

  @headers = headers
  @body = body

  @params = {}
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



74
75
76
# File 'lib/nuhttp/context.rb', line 74

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



74
75
76
# File 'lib/nuhttp/context.rb', line 74

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



74
75
76
# File 'lib/nuhttp/context.rb', line 74

def method
  @method
end

#paramsObject

: ParamsT



75
76
77
# File 'lib/nuhttp/context.rb', line 75

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



74
75
76
# File 'lib/nuhttp/context.rb', line 74

def path
  @path
end

#queryObject (readonly)

Returns the value of attribute query.



74
75
76
# File 'lib/nuhttp/context.rb', line 74

def query
  @query
end