Skip to content

Instantly share code, notes, and snippets.

@julik
Created March 5, 2009 19:49
Show Gist options
  • Save julik/74519 to your computer and use it in GitHub Desktop.
Save julik/74519 to your computer and use it in GitHub Desktop.
class VideoUpload
def self.new(*posargs_or_options)
if posargs_or_options.length > 1 # use old-style positional args
YouTubeG.logger.error "Positional arguments for VideoUpload.new are deprecated"
new(translate_posargs(posargs_or_options)
else
super(any_args.first || {}) # use the kwargs, super is just vanilla constructor
end
end
private
def self.translate_posargs(user, pass, dev_key, client_id = 'youtube_g')
{ :user => user, :password => pass, :dev_key => dev_key, :client_id => client_id }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment