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 accessing
loadKeys loadKeys
keys := STONJSON fromString: self apiKeysFile contents. keys := STONJSON fromString: self apiKeysFile contents.
^ self ^ keys

View File

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

View File

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

View File

@ -1,4 +1,4 @@
accessing accessing
loadKeys loadKeys
keys := self class 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" "keys"
], ],
"instvars" : [ "instvars" : [
"storage" "storage",
"options",
"keys"
], ],
"name" : "TwitterAPI", "name" : "TwitterAPI",
"type" : "normal" "type" : "normal"