Class: BillForward::MutableEntity
- Inherits:
-
InsertableEntity
- Object
- BillingEntity
- InsertableEntity
- BillForward::MutableEntity
- Defined in:
- lib/bill_forward/mutable_entity.rb
Direct Known Subclasses
APIConfiguration, Account, Address, AuthorizeNetToken, CreditNote, GenericEntity, Invoice, InvoiceLine, InvoicePayment, Organisation, PaymentMethod, PaymentMethodSubscriptionLink, PricingComponent, PricingComponentTier, PricingComponentValue, PricingComponentValueChange, PricingComponentValueMigrationAmendmentMapping, Product, ProductRatePlan, Profile, Refund, StripeACHToken, Subscription, SubscriptionCharge, TaxationLink, UnitOfMeasure
Instance Attribute Summary
Attributes inherited from BillingEntity
Instance Method Summary collapse
-
#delete(query_params = {}) ⇒ self
(also: #retire)
The retired Entity.
-
#initialize(*args) ⇒ MutableEntity
constructor
A new instance of MutableEntity.
-
#save ⇒ self
The updated Entity.
Methods inherited from InsertableEntity
Methods inherited from BillingEntity
#[], #[]=, #_dump, _load, build_entity, build_entity_array, #camel_case_lower, get_all, get_by_id, #method_missing, request_ambiguous, request_first_heterotyped, request_many_heterotyped, #serialize, #serialize_field, singleton_client, #state_params, #to_json, #to_ordered_hash, #to_s, #to_unordered_hash
Constructor Details
#initialize(*args) ⇒ MutableEntity
Returns a new instance of MutableEntity.
3 4 5 6 |
# File 'lib/bill_forward/mutable_entity.rb', line 3 def initialize(*args) raise AbstractInstantiateError.new('This abstract class cannot be instantiated!') if self.class == MutableEntity super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BillForward::BillingEntity
Instance Method Details
#delete(query_params = {}) ⇒ self Also known as: retire
Returns The retired Entity.
21 22 23 |
# File 'lib/bill_forward/mutable_entity.rb', line 21 def delete(query_params = {}) self.class.request_first('delete', ERB::Util.url_encode(id), query_params, nil, _client) end |
#save ⇒ self
Returns The updated Entity.
12 13 14 |
# File 'lib/bill_forward/mutable_entity.rb', line 12 def save() self.class.request_first('put', '', self, nil, _client) end |