Class: Jbr::Account

Inherits:
Resource show all
Defined in:
lib/jbr/account.rb

Overview

The Jobber account a set of credentials belongs to.

Direct Known Subclasses

Mock::Account

Constant Summary collapse

FIND =

The query that reads the account behind the current credentials.

<<~GRAPHQL
  { account { id } }
GRAPHQL

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#idString

Returns the account ID, read once and remembered.

Returns:

  • (String)

    the account ID, read once and remembered.



10
11
12
# File 'lib/jbr/account.rb', line 10

def id
  @id ||= @oauth.query(FIND).dig 'account', 'id'
end