Class: ChartMogul::Subscription
- Inherits:
-
APIResource
- Object
- Object
- APIResource
- ChartMogul::Subscription
- Includes:
- API::Actions::All, API::Actions::Custom
- Defined in:
- lib/chartmogul/subscription.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from API::Actions::Custom
#custom!, #custom_without_assign!, included
Methods included from API::Actions::All
Methods inherited from APIResource
connection, handle_other_error, handle_request_error, handling_errors, set_resource_name, set_resource_path, set_resource_root_key
Methods inherited from Object
#allowed_for_write?, #assign_all_attributes, #assign_writeable_attributes, attributes, define_private_writer, define_reader, define_writer, #initialize, #instance_attributes, new_from_json, readonly_attr, #serialize_for_write, #serialized_value_for_attr, writeable_attr, writeable_attributes
Constructor Details
This class inherits a constructor from ChartMogul::Object
Class Method Details
.all(customer_uuid, options = {}) ⇒ Object
27 28 29 |
# File 'lib/chartmogul/subscription.rb', line 27 def self.all(customer_uuid, = {}) super(.merge(customer_uuid: customer_uuid)) end |
Instance Method Details
#cancel(cancelled_at) ⇒ Object
23 24 25 |
# File 'lib/chartmogul/subscription.rb', line 23 def cancel(cancelled_at) custom!(:patch, "/v1/import/subscriptions/#{uuid}", cancelled_at: cancelled_at) end |
#set_cancellation_dates(cancellation_dates_array) ⇒ Object
17 18 19 20 21 |
# File 'lib/chartmogul/subscription.rb', line 17 def set_cancellation_dates(cancellation_dates_array) @cancellation_dates = cancellation_dates_array.map do |cancellation_date| Time.parse(cancellation_date) end end |