43 lines
687 B
Smalltalk
43 lines
687 B
Smalltalk
|
Class {
|
||
|
#name : #Airtable,
|
||
|
#superclass : #Object,
|
||
|
#instVars : [
|
||
|
'id',
|
||
|
'apiKey'
|
||
|
],
|
||
|
#category : #'Grafoscopio-Utils-Grafoscopio-Utils'
|
||
|
}
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> apiKey [
|
||
|
^ apiKey
|
||
|
]
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> apiKey: anString [
|
||
|
apiKey := anString
|
||
|
]
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> id [
|
||
|
^ id
|
||
|
]
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> id: idString [
|
||
|
id := idString
|
||
|
]
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> rawRecords [
|
||
|
^ ZnClient new
|
||
|
url: (self id);
|
||
|
headerAt: 'Authorization' put: 'Bearer ', (self apiKey);
|
||
|
get.
|
||
|
]
|
||
|
|
||
|
{ #category : #accessing }
|
||
|
Airtable >> records [
|
||
|
^ (NeoJSONReader fromString: self rawRecords contents) at: 'records'
|
||
|
]
|