Class: Airtable::Workspace

Inherits:
Resource show all
Defined in:
lib/airtable/workspace.rb

Overview

Object corresponding to an Airtable Workspace

Instance Attribute Summary

Attributes inherited from Resource

#id, #token

Instance Method Summary collapse

Methods inherited from Resource

#check_and_raise_error

Constructor Details

#initialize(token, id) ⇒ Workspace

Returns a new instance of Workspace.



5
6
7
8
# File 'lib/airtable/workspace.rb', line 5

def initialize(token, id)
  super(token)
  @id = id
end

Instance Method Details

#create_base(base_data) ⇒ Object

Parameters:

  • base_data (Hash)

    Payload for base

See Also:



12
13
14
15
16
17
18
19
# File 'lib/airtable/workspace.rb', line 12

def create_base(base_data)
  response = self.class.post('/v0/meta/bases',
                             body: base_data.merge({ workspaceId: @id }).to_json).parsed_response

  check_and_raise_error(response)

  Airtable::Base.new @token, response
end