Improving API keys loading.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-09-03 10:12:07 -05:00
parent 9e746738c9
commit 0d24cc738f
4 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,3 @@
accessing
apiKeysFile: aFileReference
apiKeysFile := aFileReference

View File

@ -0,0 +1,5 @@
accessing
apiKeysFile
"Return the defined apiKeysFile or assign a default location following the Linux Standard
File Hierarchy, which is relatively portable to other Operative Systems."
^ apiKeysFile ifNil: [ apiKeysFile := FileLocator home / '.config/Datanalitica/twitter-api-keys.json' ]

View File

@ -1,4 +1,4 @@
accessing
loadKeys
keys := STONJSON fromString: FileLocator home / '.config/Datanalitica/twitter-api-keys.json' contents.
^ self keys
keys := STONJSON fromString: self apiKeysFile contents.
^ self

View File

@ -5,6 +5,7 @@
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [
"apiKeysFile",
"keys"
],
"instvars" : [