Class: AirtableBaseBuilder::Airtable::Client
- Inherits:
-
Object
- Object
- AirtableBaseBuilder::Airtable::Client
- Defined in:
- lib/airtable_base_builder/airtable/client.rb
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#post(params: {}) ⇒ Object
params: { name: ‘My Base’, workspaceId: ‘wrk123’, tables: [{}, {}] }.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/airtable_base_builder/airtable/client.rb', line 8 def initialize @pat = AirtableBaseBuilder::Config.new.pat end |
Instance Method Details
#post(params: {}) ⇒ Object
params: { name: ‘My Base’, workspaceId: ‘wrk123’, tables: [{}, {}] }
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/airtable_base_builder/airtable/client.rb', line 13 def post(params: {}) http_connection.post( "https://api.airtable.com/v0/meta/bases", params.to_json ) rescue Faraday::ClientError => e errors_response(e.response[:body].values) rescue Faraday::ServerError errors_response(["The server responded with status 500"]) end |