Class: Smartcoin::Subscription
- Inherits:
-
SmartcoinObject
- Object
- SmartcoinObject
- Smartcoin::Subscription
- Includes:
- ApiOperations::Create, ApiOperations::Delete, ApiOperations::List, ApiOperations::Retrieve, ApiOperations::Update, ApiResource
- Defined in:
- lib/smartcoin/subscription.rb
Constant Summary
Constants included from ApiResource
ApiResource::BASE_URL, ApiResource::SSL_BUNDLE_PATH
Class Method Summary collapse
Instance Method Summary collapse
- #class_name ⇒ Object
- #create_from(params) ⇒ Object
- #delete ⇒ Object
- #serialize_params ⇒ Object
- #url ⇒ Object
Methods included from ApiOperations::List
Methods included from ApiOperations::Update
Methods included from ApiOperations::Retrieve
Methods included from ApiOperations::Create
Methods included from ApiResource
#api_request, #encode, included, #url_encode
Methods inherited from SmartcoinObject
class_name, #create_fields, create_from, #initialize, #metaclass, #method_missing, #reflesh_object, #set_properties, #to_hash, #to_json, #to_s, url
Constructor Details
This class inherits a constructor from Smartcoin::SmartcoinObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Smartcoin::SmartcoinObject
Class Method Details
.list_all ⇒ Object
26 27 28 29 30 |
# File 'lib/smartcoin/subscription.rb', line 26 def self.list_all method = :get response = api_request(url, method) create_from(response) end |
Instance Method Details
#class_name ⇒ Object
10 11 12 |
# File 'lib/smartcoin/subscription.rb', line 10 def class_name Smartcoin::Subscription.class_name end |
#create_from(params) ⇒ Object
14 15 16 |
# File 'lib/smartcoin/subscription.rb', line 14 def create_from(params) Smartcoin::Subscription.create_from(params) end |
#delete ⇒ Object
32 33 34 35 36 37 |
# File 'lib/smartcoin/subscription.rb', line 32 def delete method = :delete response = api_request("#{url}/#{self.id}",method) reflesh_object(response) response end |
#serialize_params ⇒ Object
18 19 20 |
# File 'lib/smartcoin/subscription.rb', line 18 def serialize_params [:plan, :quantity] end |