class BillForward::Account

This entity exposes the following child entities via method_missing:

Role[] .roles PaymentMethod[] .paymentMethods Profile .profile

Public Class Methods

credit(id, request_object = {}, custom_client = nil) click to toggle source
# File lib/bill_forward/entities/account.rb, line 11
def credit(id, request_object = {}, custom_client = nil)
  raise ArgumentError.new("id cannot be nil") if id.nil?

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

  request_entity = BillForward::GenericEntity.new(
      request_object
  )

  self.request_first_heterotyped(BillForward::CreditNote, 'post', endpoint, request_entity, nil, custom_client)
end

Protected Instance Methods

unserialize_all(hash) click to toggle source
Calls superclass method
# File lib/bill_forward/entities/account.rb, line 27
def unserialize_all(hash)
  super
  unserialize_entity('profile', Profile, hash)

  unserialize_array_of_entities('roles', Role, hash)
  unserialize_array_of_entities('paymentMethods', PaymentMethod, hash)
end