Guest User

Untitled

a guest
Mar 2nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class VideoUpload
  2.  
  3. def self.new(*posargs_or_options)
  4. if posargs_or_options.length > 1 # use old-style positional args
  5. YouTubeG.logger.error "Positional arguments for VideoUpload.new are deprecated"
  6. new(translate_posargs(posargs_or_options)
  7. else
  8. super(any_args.first || {}) # use the kwargs, super is just vanilla constructor
  9. end
  10. end
  11.  
  12. private
  13. def self.translate_posargs(user, pass, dev_key, client_id = 'youtube_g')
  14. { :user => user, :password => pass, :dev_key => dev_key, :client_id => client_id }
  15. end
  16. end
Add Comment
Please, Sign In to add comment