Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.on_success should return the block result not the instance #26

Open
arturictus opened this issue May 13, 2020 · 0 comments
Open

.on_success should return the block result not the instance #26

arturictus opened this issue May 13, 2020 · 0 comments

Comments

@arturictus
Copy link
Owner

out = GithubCLI::User.new(username: 'arturictus')
               .on_success do |inst|
                 inst.status_code # => 200
                 inst.body # => {"login"=>"arturictus", "id"=>1930175, ...}
                 # do something useful
               end.on_error do |inst|
                 puts "Error retrieving use"
               end

Right now out is the User instance. Should be the body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant