Class: Cb::Responses::RawApiResponse
- Inherits:
-
Object
- Object
- Cb::Responses::RawApiResponse
- Defined in:
- lib/cb/responses/raw_api_response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#raw_api_hash ⇒ Object
Returns the value of attribute raw_api_hash.
Instance Method Summary collapse
- #extract_models ⇒ Object
-
#initialize(raw_api_response = {}) ⇒ RawApiResponse
constructor
A new instance of RawApiResponse.
- #validate_raw_api_response ⇒ Object
Constructor Details
#initialize(raw_api_response = {}) ⇒ RawApiResponse
7 8 9 10 |
# File 'lib/cb/responses/raw_api_response.rb', line 7 def initialize(raw_api_response={}) @raw_api_hash = raw_api_response validate_raw_api_response end |
Instance Attribute Details
#raw_api_hash ⇒ Object
Returns the value of attribute raw_api_hash.
5 6 7 |
# File 'lib/cb/responses/raw_api_response.rb', line 5 def raw_api_hash @raw_api_hash end |
Instance Method Details
#extract_models ⇒ Object
18 19 20 21 |
# File 'lib/cb/responses/raw_api_response.rb', line 18 def extract_models # your api hash is considered valid at this point - grab the data you need and turn it into model(s) raise NotImplementedError.new(__method__) end |
#validate_raw_api_response ⇒ Object
12 13 14 15 16 |
# File 'lib/cb/responses/raw_api_response.rb', line 12 def validate_raw_api_response # call #required_response_field in here for each node that you know you'll need - stuff like the root node # or the node that contains the data from which your model is built. raise NotImplementedError.new(__method__) end |