Module: BookingSync::API::Client::Accounts

Included in:
BookingSync::API::Client
Defined in:
lib/bookingsync/api/client/accounts.rb

Instance Method Summary collapse

Instance Method Details

#account(account, options = {}) ⇒ BookingSync::API::Resource

Get a single account

Parameters:

  • account (BookingSync::API::Resource|Integer)

    Account or ID of the account.

  • options (Hash) (defaults to: {})

    A customizable set of query options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:



26
27
28
# File 'lib/bookingsync/api/client/accounts.rb', line 26

def (, options = {})
  get("accounts/#{}", options).pop
end

#accounts(options = {}, &block) ⇒ Array<BookingSync::API::Resource>

List accounts

Returns all the accounts that the user is authenticated with.

Examples:

Get the list of accounts for the current account

accounts = @api.accounts
accounts.first.email # => "[email protected]"

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



15
16
17
# File 'lib/bookingsync/api/client/accounts.rb', line 15

def accounts(options = {}, &block)
  paginate :accounts, options, &block
end