-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add token_info method, bump version #9
Conversation
6bbff68
to
d491dea
Compare
lib/panda/client.rb
Outdated
def get_token(path, params = {}) | ||
request = Panda::HTTPRequest.new('GET', path, params) | ||
response = Panda.make_get_request(request) | ||
response.status == 200 ? response.parsed_body : nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need in checking status, error middleware will handle all non successful requests. Please add a separate structure that wraps raw response from TikTok like we do with collections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collection is a wrapper around enumerable with pagination. We don't have pagination here, I can just fetch data
from response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wrap raw responses from API with our objects. Please, create a response object for this API and return it from this method
6079de9
to
e19b92a
Compare
e19b92a
to
3ca8cd2
Compare
6b6cb78
to
53f8b9e
Compare
|
||
module Panda | ||
class TokenInfo | ||
attr_reader :data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we don't use this reader anywhere
lib/panda/client.rb
Outdated
@@ -1,6 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
require 'panda/collection' | |||
require 'panda/token_info' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep imports sorted as they were
No description provided.