Class: Pandexio::Request
- Inherits:
-
Object
- Object
- Pandexio::Request
- Defined in:
- lib/request.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#query_parameters ⇒ Object
Returns the value of attribute query_parameters.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Request
constructor
A new instance of Request.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 14 |
# File 'lib/request.rb', line 8 def initialize(params = {}) @method = params.fetch(:method, nil) @path = params.fetch(:path, nil) @query_parameters = params.fetch(:query_parameters, {}) @headers = params.fetch(:headers, {}) @payload = params.fetch(:payload, nil) end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
19 20 21 |
# File 'lib/request.rb', line 19 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
16 17 18 |
# File 'lib/request.rb', line 16 def method @method end |
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/request.rb', line 17 def path @path end |
#payload ⇒ Object
Returns the value of attribute payload.
20 21 22 |
# File 'lib/request.rb', line 20 def payload @payload end |
#query_parameters ⇒ Object
Returns the value of attribute query_parameters.
18 19 20 |
# File 'lib/request.rb', line 18 def query_parameters @query_parameters end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/request.rb', line 22 def to_s "#{@method} #{@path}#{LINE_BREAK}query_parameters: #{query_parameters}#{LINE_BREAK}headers: #{headers}#{LINE_BREAK}payload: #{payload}" end |