Class: BillForward::APIConfiguration

Inherits:
MutableEntity show all
Defined in:
lib/bill_forward/entities/api_configuration.rb

Instance Attribute Summary

Attributes inherited from BillingEntity

#_client

Class Method Summary collapse

Methods inherited from MutableEntity

#delete, #initialize, #save

Methods inherited from InsertableEntity

#initialize

Methods inherited from BillingEntity

#[], #[]=, #_dump, _load, build_entity, build_entity_array, #camel_case_lower, get_all, get_by_id, #initialize, #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

This class inherits a constructor from BillForward::MutableEntity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BillForward::BillingEntity

Class Method Details

.create(entity = nil) ⇒ Object



6
7
8
9
10
# File 'lib/bill_forward/entities/api_configuration.rb', line 6

def create(entity = nil)
	raise DenyMethod.new 'Create support is denied for this entity; '+
'at the time of writing, no API endpoint exists to support it. '+
'The entity can be created through cascade only (i.e. instantiated within another entity).'
end

.get_by_type(type, query_params = {}, custom_client = nil) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
19
20
# File 'lib/bill_forward/entities/api_configuration.rb', line 12

def get_by_type(type, query_params = {}, custom_client = nil)
	raise ArgumentError.new("type cannot be nil") if type.nil?

	endpoint = sprintf('type/%s',
		ERB::Util.url_encode(type)
	)

	self.request_first('get', endpoint, query_params, custom_client)
end