Every sfa_* function requires two inputs: api_key = getOption("sfa_api_key") and cache_dir = getOption("sfa_cache_dir"). If we would implement a simple class which stores these two arguments, all existing functions could be implemented as methods of this class. All these methods would be simplified because the arguments above would be already set.
The syntax would look something like this:
sfa <- SimFinAPI(api_key = ..., cache_dir = ...) # instantiate the class
sfa$load_companies()
If we ever get to offer bulk downloads as well, this might also be beneficial since the class object could be used to keep track of already downloaded files.
Every
sfa_*
function requires two inputs:api_key = getOption("sfa_api_key")
andcache_dir = getOption("sfa_cache_dir")
. If we would implement a simple class which stores these two arguments, all existing functions could be implemented as methods of this class. All these methods would be simplified because the arguments above would be already set.The syntax would look something like this:
If we ever get to offer bulk downloads as well, this might also be beneficial since the class object could be used to keep track of already downloaded files.