Skip to content

Remote API discussion #2

@winston

Description

@winston

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions