Project

airbased

0.0
There's a lot of open issues
Ruby interface to the Airtable’s API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

Airbased

Ruby interface to the Airtable’s API.

Note

The library is in early development, so breaking changes are possible. It implements all records API methods (including batch operations), except Sync CSV data and attachment upload.

Feedback and contributions are most welcome!

Start using Airbased

Install the gem.

gem install airbased --pre

Or in a Gemfile:

gem 'airbased', '0.0.1-alpha'

Define an API key, then define a base.

Airbased.api_key = "patxxx"

# define a new base
MyBase = Airbased::Base.new("appxxxxxxxxxxxxxx")

# define a table from the base's schema
MyTable = MyBase["Table 1"] # you can use table name or id

# ... or though an ad-hoc definition
MyTable = Airbased.table(Airbased.api_key, "appxxxxxxxxxxxxxx", "tblxxxxxxxxxxxxxx")

# create a record
new_record = MyTable.create({"Name" => "a new name"})

# ... or many records at once, Airbased will take care of batching!
fields = [{ "Name" => "a new name 2" }, {"Name" => "a new name 3"}]
records = MyTable.create(fields)

# delete a record
new_record.delete

# fetch records
records = MyTable.all

# update records
record = records[0]
record["Name"] = "newer name"
record.save

# upsert records
records = MyTable.upsert(fields, merge_on: ["Name"])

# if something goes wrong...
Airbased.debug = true
# will write requests info into stdout