Closed DaWe35 closed 4 years ago
Looks good to me. Just needs the changes m-cat already mentioned.
@m-cat 1. What about making default_upload_options
and default_download_options
able to handle deficient opts
? I mean do we really need the fill_with...
functions?
@m-cat 1. What about making
default_upload_options
anddefault_download_options
able to handle deficientopts
? I mean do we really need thefill_with...
functions?
Interesting idea. In my opinion the default_
functions should just return the default opts
as before. I don't see the reason for a user to pass in a deficient opts
, the upload and download methods will just fill in the missing opts
anyway. I would keep the default_
functions simple, behaving the same way as in the other SDKs, while we make the fill_with
functions private. This way we don't complicate the API at all and still have elegant option-filling internally.
@DaWe35 Since these are static methods there is no class instance, you need to do Skynet.fill_with_default_upload_options()
Okay, I've seen you've done that. Looks great to me! Will give it one more look-through.
This PR includes two backward-compatible updates.
opts
parameter, it was mandatory to declare all variables in theopts
object. Now you can declare the variables that are important for you, and leave the rest default. Example:Complete example for upload (source):