Class: CoinbaseCommerce::APIResources::Base::APIResource
- Defined in:
- lib/coinbase_commerce/api_resources/base/api_resource.rb
Overview
Base resource class if you need to add additional API resource, inherit from APIResource
Class Attribute Summary collapse
-
.client ⇒ Object
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from APIObject
#[], #[]=, create_from, #each, #initialize, #initialize_from, #inspect, #keys, #method_missing, #respond_to_missing?, #serialize_params, #serialize_params_value, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from CoinbaseCommerce::APIResources::Base::APIObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CoinbaseCommerce::APIResources::Base::APIObject
Class Attribute Details
.client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/coinbase_commerce/api_resources/base/api_resource.rb', line 8 def client @client end |
Class Method Details
.retrieve(id, params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/coinbase_commerce/api_resources/base/api_resource.rb', line 13 def self.retrieve(id, params = {}) resp = @client.request(:get, "#{self::RESOURCE_PATH}/#{id}", params) Util.convert_to_api_object(resp.data, @client, self) end |
Instance Method Details
#refresh(params = {}) ⇒ Object
18 19 20 21 |
# File 'lib/coinbase_commerce/api_resources/base/api_resource.rb', line 18 def refresh(params = {}) resp = @client.request(:get, "#{self.class::RESOURCE_PATH}/#{self[:id]}", params) initialize_from(resp.data) end |