Am thinking that from the dependency injection angle (I hope I am using this correctly),
that the remote API might look better like this?
# current
client = Octokit::Client.new(access_token: ENV["OAUTH_TOKEN"])
news = Whatsnew.about client.contents("jollygoodcode/whatsnew")
# proposal
client = Octokit::Client.new(access_token: ENV["OAUTH_TOKEN"])
news = Whatsnew.about "jollygoodcode/whatsnew", client
So the client is passed in as an object. In the future, maybe can extend to BitBucket?
Otherwise the code is right now coupled to Sawyer::Resource.
wdyt?
Great work btw! :)
Am thinking that from the dependency injection angle (I hope I am using this correctly),
that the remote API might look better like this?
So the client is passed in as an object. In the future, maybe can extend to BitBucket?
Otherwise the code is right now coupled to
Sawyer::Resource.wdyt?
Great work btw! :)