Class: DpdApi::Client::Response::ResourceBuilder
- Inherits:
-
Object
- Object
- DpdApi::Client::Response::ResourceBuilder
- Defined in:
- lib/dpd_api/client/response.rb
Instance Attribute Summary collapse
-
#merged_params ⇒ Object
readonly
Returns the value of attribute merged_params.
-
#request_params ⇒ Object
readonly
Returns the value of attribute request_params.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
Instance Method Summary collapse
-
#initialize(client, method, params = {}, options = {}) ⇒ ResourceBuilder
constructor
A new instance of ResourceBuilder.
- #resources ⇒ Object
Constructor Details
#initialize(client, method, params = {}, options = {}) ⇒ ResourceBuilder
Returns a new instance of ResourceBuilder.
31 32 33 34 35 36 37 |
# File 'lib/dpd_api/client/response.rb', line 31 def initialize(client, method, params = {}, = {}) @client = client @method = method @params = params @namespace = .delete(:namespace) @merged_params = merge_auth_params end |
Instance Attribute Details
#merged_params ⇒ Object (readonly)
Returns the value of attribute merged_params.
29 30 31 |
# File 'lib/dpd_api/client/response.rb', line 29 def merged_params @merged_params end |
#request_params ⇒ Object (readonly)
Returns the value of attribute request_params.
29 30 31 |
# File 'lib/dpd_api/client/response.rb', line 29 def request_params @request_params end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
29 30 31 |
# File 'lib/dpd_api/client/response.rb', line 29 def response_body @response_body end |
Instance Method Details
#resources ⇒ Object
39 40 41 42 43 44 |
# File 'lib/dpd_api/client/response.rb', line 39 def resources namespace = "#{@method}_response".to_sym @response_body = response.body resources = @response_body[namespace][:return] resources.is_a?(Array) ? resources : [] << resources end |