Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ah, _method is a reserved keyword in ruby.

  • Loading branch information...
commit 9954362988c16a28f2e4cb06fd0f9256502ac576 1 parent 9bc60b3
@clayallsopp authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 gumroad.rb
View
16 gumroad.rb
@@ -33,15 +33,15 @@ def uri(route)
URI.parse(self.url(route))
end
- # method is string
- def authed_request(uri, method, params = {})
- klass = method.capitalize
+ # _method is string
+ def authed_request(uri, _method, params = {})
+ klass = _method.capitalize
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::const_get(klass).new(uri.request_uri)
- request.set_form_data(params) if method != "get"
+ request.set_form_data(params) if _method != "get"
if @token and @password
request.basic_auth(@token, @password)
end
@@ -59,10 +59,10 @@ def authed_request(uri, method, params = {})
# Client handles functions of the form
# Client.[method](resource, params = {})
- def method_missing(method, *args, &block)
- if [:post, :delete, :put].member? method
- return authed_request(self.uri(args[0]), method.to_s, args[1]) if args.length == 2
- return authed_request(self.uri(args[0]), method.to_s, {}) if args.length == 1
+ def method_missing(_method, *args, &block)
+ if [:post, :delete, :put].member? _method
+ return authed_request(self.uri(args[0]), _method.to_s, args[1]) if args.length == 2
+ return authed_request(self.uri(args[0]), _method.to_s, {}) if args.length == 1
else
super
end
Please sign in to comment.
Something went wrong with that request. Please try again.