Major update, primarily to add pagination support.
* Added Reference objects to encapsulate API calls. * Added Result objects to encapsulate API responses. * Changed the return value of APIClient#execute to Result. * Changed the method signature of APIClient#execute to support named params. * Added APIClient#execute! which throws exceptions on error. * Added automatic parsing code to better allow for complex nested structures. * Added error parser. * Added module for pagination in parsers.
This commit is contained in:
1 parent
a656c13862
commit
f336ab34a7
15 files changed
+821
-306
No files matched your search
+4
-4
@@ -75,10 +75,10 @@ get '/oauth2callback' do
|
||||
end
|
||||
|
||||
get '/' do
|
||||
response = @client.execute(
|
||||
result = @client.execute(
|
||||
@buzz.activities.list,
|
||||
'userId' => '@me', 'scope' => '@consumption', 'alt'=> 'json'
|
||||
{'userId' => '@me', 'scope' => '@consumption', 'alt'=> 'json'}
|
||||
)
|
||||
status, headers, body = response
|
||||
[status, {'Content-Type' => 'application/json'}, body]
|
||||
status, _, _ = result.response
|
||||
[status, {'Content-Type' => 'application/json'}, JSON.generate(result.data)]
|
||||
end
|
||||
Reference in new issue
Block a user