Module: Billrb::Operations

Defined in:
lib/billrb/operations.rb

Overview

CRUD mixins for resource classes. Each resource ‘extend`s only the operations its endpoint supports, so adding a new BILL module is a new file declaring its path and operations — no existing code changes.

Every method takes a trailing options hash; pass ‘client:` there to use a client other than the default (e.g. Customer.retrieve(id, client: other)).

Defined Under Namespace

Modules: Archive, Create, List, Replace, Retrieve, Update

Class Method Summary collapse

Class Method Details

.client_from(options) ⇒ Object



11
12
13
# File 'lib/billrb/operations.rb', line 11

def self.client_from(options)
  options[:client] || Billrb.client
end