lib/fastly/base.rb in fastly-1.1.4 vs lib/fastly/base.rb in fastly-1.1.5
- old
+ new
@@ -3,13 +3,13 @@
class Base # :nodoc: all
attr_accessor :fetcher
def initialize(opts, fetcher)
@keys = []
- opts.each do |key,val|
+ opts.each do |key, val|
next unless self.respond_to? "#{key}="
- self.send("#{key}=", val)
+ send("#{key}=", val)
@keys.push(key)
end
self.fetcher = fetcher
end
@@ -26,11 +26,11 @@
##
# :nodoc:
def as_hash
ret = {}
@keys.each do |key|
- ret[key] = self.send("#{key}") unless key =~ /^_/;
+ ret[key] = send("#{key}") unless key =~ /^_/
end
ret
end
def require_api_key!
@@ -43,22 +43,22 @@
def self.get_path(id)
"/#{path}/#{id}"
end
- def self.post_path(opts={})
+ def self.post_path(_opts = {})
"/#{path}"
end
- def self.list_path(opts={})
+ def self.list_path(opts = {})
post_path(opts)
end
- def self.put_path(obj)
- get_path(obj.id)
+ def self.put_path(object)
+ get_path(object.id)
end
- def self.delete_path(obj)
- put_path(obj)
+ def self.delete_path(object)
+ put_path(object)
end
end
end