Class: Airtable::Record

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

Overview

Object corresponding to an Airtable Record

Instance Attribute Summary collapse

Attributes inherited from Resource

#id, #token

Instance Method Summary collapse

Methods inherited from Resource

#check_and_raise_error

Constructor Details

#initialize(token, base_id, table_id, api_response) ⇒ Record

Returns a new instance of Record.



7
8
9
10
11
12
13
14
15
# File 'lib/airtable/record.rb', line 7

def initialize(token, base_id, table_id, api_response)
  @token = token
  @base_id = base_id
  @table_id = table_id
  api_response.deep_symbolize_keys.each do |key, value|
    instance_variable_set(:"@#{key}", value)
  end
  self.class.headers({ 'Authorization': "Bearer #{@token}", 'Content-Type': 'application/json' })
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



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

def fields
  @fields
end