Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Created February 5, 2014 12:49
Show Gist options
  • Save adambeynon/8822944 to your computer and use it in GitHub Desktop.
Save adambeynon/8822944 to your computer and use it in GitHub Desktop.
Promise.new do |promise|
HTTP.get(url, :GET, opts) do |response|
if response.ok?
promise.resolve response
else
promise.reject response
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment