Fixing API keys loading.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-09-15 13:07:48 -05:00
parent 310cfe9dfc
commit 3e79d80267
7 changed files with 19 additions and 5 deletions

View File

@ -1,4 +1,4 @@
accessing
loadKeys
keys := STONJSON fromString: self apiKeysFile contents.
^ self
^ keys

View File

@ -1,3 +1,3 @@
accessing
bearerToken
^ self keys at: 'Bearer Token'
^ self class keys at: 'Bearer Token'

View File

@ -1,3 +1,3 @@
accessing
keys
^ keys ifNil: [ keys := Dictionary new]
^ keys ifNil: [ keys := self class loadKeys]

View File

@ -1,4 +1,4 @@
accessing
loadKeys
keys := self class loadKeys.
^ keys
^ self

View File

@ -0,0 +1,3 @@
accessing
options: aDictionary
options := aDictionary

View File

@ -0,0 +1,9 @@
accessing
options
"Return the configuration options or define a default if they are not given"
^ options ifNil: [
options := Dictionary new
at: 'caching' put: true;
at: 'pagesPerRequest' put: '1';
yourself
]

View File

@ -9,7 +9,9 @@
"keys"
],
"instvars" : [
"storage"
"storage",
"options",
"keys"
],
"name" : "TwitterAPI",
"type" : "normal"