Skip to content

Instantly share code, notes, and snippets.

@rromanchuk
Last active August 29, 2015 13:57
Show Gist options
  • Save rromanchuk/92b78b1f3a6dd4e12b39 to your computer and use it in GitHub Desktop.
Save rromanchuk/92b78b1f3a6dd4e12b39 to your computer and use it in GitHub Desktop.
def self.APISearchUsers(q)
@searchConnection.cancel if @searchConnection
url = API.usersURL
params = API.defaultParams({ q: q })
@searchConnection = ApiClient.client.get(url, params) do |result|
if result.success? && result.object
puts "request state #{result.task.state}"
@searchConnection = nil
else
// Error
@searchConnection = nil
end
end
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment