class Yt::Collections::Authentications
@private
Attributes
Private Instance Methods
Source
# File lib/yt/collections/authentications.rb, line 12 def attributes_for_new_item(data) data['refresh_token'] ||= auth_params[:refresh_token] data end
Source
# File lib/yt/collections/authentications.rb, line 42 def expected?(error) error.kind == 'invalid_grant' && invalid_code_errors.exclude?(error.description) end
Source
# File lib/yt/collections/authentications.rb, line 49 def invalid_code_errors ["Code was already redeemed.", "Invalid code."] end
Source
# File lib/yt/collections/authentications.rb, line 17 def list_params super.tap do |params| params[:host] = 'oauth2.googleapis.com' params[:path] = '/token' params[:request_format] = :form params[:method] = :post params[:auth] = nil params[:body] = auth_params params[:camelize_body] = false end end
Calls superclass method
Source
# File lib/yt/collections/authentications.rb, line 29 def more_pages? auth_params.values.all? end
Source
# File lib/yt/collections/authentications.rb, line 33 def next_page request = Yt::Request.new(list_params).tap do |request| print "#{request.as_curl}\n" if Yt.configuration.developing? end Array.wrap request.run.body rescue Yt::Error => error expected?(error) ? [] : raise(error) end