Class: ChartMogul::SubscriptionEvent
- Inherits:
-
APIResource
- Object
- Object
- APIResource
- ChartMogul::SubscriptionEvent
- Defined in:
- lib/chartmogul/subscription_event.rb
Constant Summary
Constants inherited from APIResource
APIResource::BACKOFF_FACTOR, APIResource::INTERVAL, APIResource::INTERVAL_RANDOMNESS, APIResource::MAX_INTERVAL, APIResource::RETRY_EXCEPTIONS, APIResource::RETRY_STATUSES, APIResource::THREAD_CONNECTION_KEY
Class Method Summary collapse
- .all(options = {}) ⇒ Object
-
.create!(attributes) ⇒ Object
This endpoint requires we send the attributes as: { subscription_event: { key: value }} So we do not include the API::Actions::Create module here and rather use a variation of the method there to accommodate this difference in behaviour.
Instance Method Summary collapse
Methods included from API::Actions::DestroyWithParams
#destroy_with_params!, included
Methods included from API::Actions::Custom
#custom!, #custom_without_assign!, included
Methods inherited from APIResource
build_connection, connection, custom_with_query_params!, #custom_with_query_params!, extract_query_params, #extract_query_params, handle_other_error, handle_request_error, handling_errors, immutable_keys, #path_with_query_params, query_params, set_immutable_keys, set_resource_name, set_resource_path, set_resource_root_key, writeable_query_param
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(options = {}) ⇒ Object
31 32 33 |
# File 'lib/chartmogul/subscription_event.rb', line 31 def self.all( = {}) SubscriptionEvents.all() end |
.create!(attributes) ⇒ Object
This endpoint requires we send the attributes as: { subscription_event: { key: value }} So we do not include the API::Actions::Create module here and rather use a variation of the method there to accommodate this difference in behaviour.
43 44 45 |
# File 'lib/chartmogul/subscription_event.rb', line 43 def self.create!(attributes) custom_with_query_params!(:post, { subscription_event: attributes }, :subscription_event) end |
Instance Method Details
#create! ⇒ Object
35 36 37 |
# File 'lib/chartmogul/subscription_event.rb', line 35 def create! custom_with_query_params!(:post, { subscription_event: instance_attributes }, :subscription_event) end |
#destroy! ⇒ Object
52 53 54 55 56 |
# File 'lib/chartmogul/subscription_event.rb', line 52 def destroy! handling_errors do connection.delete(resource_path.path, subscription_event: { id: instance_attributes[:id] }) end end |
#update!(attrs) ⇒ Object
47 48 49 50 |
# File 'lib/chartmogul/subscription_event.rb', line 47 def update!(attrs) custom_with_query_params!(:patch, { subscription_event: attrs.merge(id: instance_attributes[:id]) }, :subscription_event) end |