Class: AirtableBaseBuilder::Airtable::Table

Inherits:
Client
  • Object
show all
Defined in:
lib/airtable_base_builder/airtable/table.rb

Instance Method Summary collapse

Methods inherited from Client

#post

Constructor Details

#initialize(name, fields) ⇒ Table

Returns a new instance of Table.



8
9
10
11
# File 'lib/airtable_base_builder/airtable/table.rb', line 8

def initialize(name, fields)
  @name = name
  @fields = fields
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
20
# File 'lib/airtable_base_builder/airtable/table.rb', line 13

def build
  {
    name: @name,
    fields: @fields.map do |field|
      Airtable::Field.new(field).build
    end
  }
end