Class: Apia::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Apia::Request
- Defined in:
- lib/apia/request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#api_path ⇒ Object
Returns the value of attribute api_path.
- #arguments ⇒ Object
-
#authenticator ⇒ Object
Returns the value of attribute authenticator.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#route ⇒ Object
Returns the value of attribute route.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
10 11 12 |
# File 'lib/apia/request.rb', line 10 def api @api end |
#api_path ⇒ Object
Returns the value of attribute api_path.
18 19 20 |
# File 'lib/apia/request.rb', line 18 def api_path @api_path end |
#arguments ⇒ Object
24 25 26 |
# File 'lib/apia/request.rb', line 24 def arguments @arguments ||= {} end |
#authenticator ⇒ Object
Returns the value of attribute authenticator.
15 16 17 |
# File 'lib/apia/request.rb', line 15 def authenticator @authenticator end |
#controller ⇒ Object
Returns the value of attribute controller.
11 12 13 |
# File 'lib/apia/request.rb', line 11 def controller @controller end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
12 13 14 |
# File 'lib/apia/request.rb', line 12 def endpoint @endpoint end |
#identity ⇒ Object
Returns the value of attribute identity.
13 14 15 |
# File 'lib/apia/request.rb', line 13 def identity @identity end |
#namespace ⇒ Object
Returns the value of attribute namespace.
16 17 18 |
# File 'lib/apia/request.rb', line 16 def namespace @namespace end |
#route ⇒ Object
Returns the value of attribute route.
17 18 19 |
# File 'lib/apia/request.rb', line 17 def route @route end |
Class Method Details
.empty(options: {}) ⇒ Object
20 21 22 |
# File 'lib/apia/request.rb', line 20 def self.empty(options: {}) new() end |
Instance Method Details
#body? ⇒ Boolean
38 39 40 |
# File 'lib/apia/request.rb', line 38 def body? has_header?(::Rack::RACK_INPUT) end |
#headers ⇒ Object
28 29 30 |
# File 'lib/apia/request.rb', line 28 def headers @headers ||= RequestHeaders.create_from_request(self) end |
#json_body ⇒ Object
32 33 34 35 36 |
# File 'lib/apia/request.rb', line 32 def json_body return @json_body if instance_variable_defined?('@json_body') @json_body = get_json_body_from_body || get_json_body_from_params end |
#params ⇒ Object
42 43 44 45 46 |
# File 'lib/apia/request.rb', line 42 def params return {} unless body? super end |