Class: Airtable::Resource

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/airtable/resource.rb

Overview

Base class for authorized resources sending network requests

Direct Known Subclasses

Table

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, app_token, worksheet_name) ⇒ Resource

Returns a new instance of Resource.



10
11
12
13
14
15
# File 'lib/airtable/resource.rb', line 10

def initialize(api_key, app_token, worksheet_name)
  @api_key = api_key
  @app_token = app_token
  @worksheet_name = worksheet_name
  self.class.headers({'Authorization' => "Bearer #{@api_key}"})
end

Instance Attribute Details

#api_keyObject (readonly)

debug_output $stdout



8
9
10
# File 'lib/airtable/resource.rb', line 8

def api_key
  @api_key
end

#app_tokenObject (readonly)

debug_output $stdout



8
9
10
# File 'lib/airtable/resource.rb', line 8

def app_token
  @app_token
end

#worksheet_nameObject (readonly)

debug_output $stdout



8
9
10
# File 'lib/airtable/resource.rb', line 8

def worksheet_name
  @worksheet_name
end