Class: Airtable::Client
Overview
Client carrying authorization token
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#base(base_id) ⇒ Airtable::Base
Instantiate base.
- #bases ⇒ Array<Airtable::Base>
-
#whoami ⇒ Hash
User’s data based on token.
-
#workspace(workspace_id) ⇒ Airtable::Workspace
Instantiate workspace.
Methods inherited from Resource
#check_and_raise_error, #initialize
Constructor Details
This class inherits a constructor from Airtable::Resource
Instance Method Details
#base(base_id) ⇒ Airtable::Base
Instantiate base
25 26 27 |
# File 'lib/airtable/client.rb', line 25 def base(base_id) Airtable::Base.new(@token, base_id) end |
#bases ⇒ Array<Airtable::Base>
7 8 9 10 11 12 13 |
# File 'lib/airtable/client.rb', line 7 def bases response = self.class.get('/v0/meta/bases').parsed_response check_and_raise_error(response) response['bases'].map { Airtable::Base.new(@token, _1['id']) } end |
#whoami ⇒ Hash
Returns User’s data based on token.
31 32 33 34 35 36 37 |
# File 'lib/airtable/client.rb', line 31 def whoami response = self.class.get('/v0/meta/whoami').parsed_response check_and_raise_error(response) response end |
#workspace(workspace_id) ⇒ Airtable::Workspace
Instantiate workspace
18 19 20 |
# File 'lib/airtable/client.rb', line 18 def workspace(workspace_id) Airtable::Workspace.new(@token, workspace_id) end |