Class: HttpRequestImpl
- Inherits:
-
Object
show all
- Defined in:
- lib/resurfaceio/http_request_impl.rb
Overview
© 2016-2021 Resurface Labs Inc.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HttpRequestImpl.
6
7
8
9
10
11
|
# File 'lib/resurfaceio/http_request_impl.rb', line 6
def initialize
@form_hash = Hash.new
@headers = Hash.new
@query_hash = Hash.new
@session = Hash.new
end
|
Instance Attribute Details
#request_method ⇒ Object
Returns the value of attribute request_method.
48
49
50
|
# File 'lib/resurfaceio/http_request_impl.rb', line 48
def request_method
@request_method
end
|
#url ⇒ Object
Returns the value of attribute url.
49
50
51
|
# File 'lib/resurfaceio/http_request_impl.rb', line 49
def url
@url
end
|
Instance Method Details
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/resurfaceio/http_request_impl.rb', line 13
def (key, value)
unless value.nil?
existing = @headers[key]
if existing.nil?
@headers[key] = value
else
@headers[key] = "#{existing}, #{value}"
end
end
end
|
#content_type ⇒ Object
24
25
26
|
# File 'lib/resurfaceio/http_request_impl.rb', line 24
def content_type
@headers['CONTENT_TYPE']
end
|
#content_type=(content_type) ⇒ Object
28
29
30
|
# File 'lib/resurfaceio/http_request_impl.rb', line 28
def content_type=(content_type)
@headers['CONTENT_TYPE'] = content_type
end
|
32
33
34
|
# File 'lib/resurfaceio/http_request_impl.rb', line 32
def form_hash
@form_hash
end
|
36
37
38
|
# File 'lib/resurfaceio/http_request_impl.rb', line 36
def
@headers
end
|
#query_hash ⇒ Object
40
41
42
|
# File 'lib/resurfaceio/http_request_impl.rb', line 40
def query_hash
@query_hash
end
|
#session ⇒ Object
44
45
46
|
# File 'lib/resurfaceio/http_request_impl.rb', line 44
def session
@session
end
|