Class: AppStoreConnectApi::Response
- Inherits:
-
Object
- Object
- AppStoreConnectApi::Response
- Defined in:
- lib/app_store_connect_api/response.rb
Instance Method Summary collapse
-
#initialize(raw_response, relationships = '') ⇒ Response
constructor
A new instance of Response.
- #response ⇒ Object
Constructor Details
#initialize(raw_response, relationships = '') ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 13 |
# File 'lib/app_store_connect_api/response.rb', line 7 def initialize(raw_response, relationships = '') relationships = '' if relationships.nil? relationships = relationships.split(",") @raw_response = snake_case(raw_response) @relationships = snake_case(relationships) end |
Instance Method Details
#response ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/app_store_connect_api/response.rb', line 15 def response return if @raw_response.empty? raise Error, @raw_response unless @raw_response.is_a? Hash if @raw_response.key? :errors raise ApiError, @raw_response[:errors] elsif @raw_response.key? :data process_data_from_response end end |