Class: Printavo::Resources::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/printavo/resources/account.rb

Overview

Singleton resource — Printavo exposes one account per API credential. Use client.account.find (no ID argument required).

Constant Summary collapse

FIND_QUERY =
File.read(File.join(__dir__, '../graphql/account/find.graphql')).freeze

Instance Method Summary collapse

Methods inherited from Base

#all_pages, #each_page, #initialize

Constructor Details

This class inherits a constructor from Printavo::Resources::Base

Instance Method Details

#findPrintavo::Account

Returns the account associated with the current API credentials.

Examples:

 = client..find
puts .company_name   # => "Texas Embroidery Ranch"
puts .locale         # => "en-US"

Returns:



19
20
21
22
# File 'lib/printavo/resources/account.rb', line 19

def find
  data = @graphql.query(FIND_QUERY)
  Printavo::Account.new(data['account'])
end