Class: BillForward::MutableEntity

Inherits:
InsertableEntity show all
Defined in:
lib/bill_forward/mutable_entity.rb

Instance Attribute Summary

Attributes inherited from BillingEntity

#_client

Instance Method Summary collapse

Methods inherited from InsertableEntity

create

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.

Returns:

  • (self)

    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

#saveself

Returns The updated Entity.

Returns:

  • (self)

    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