lib/fastly/settings.rb in fastly-1.1.4 vs lib/fastly/settings.rb in fastly-1.1.5
- old
+ new
@@ -1,5 +1,6 @@
+# Settings Object
class Fastly
# Represent arbitary key value settings for a given Version
class Settings < Base
attr_accessor :service_id, :version, :settings
##
@@ -29,46 +30,44 @@
def self.put_path(obj)
get_path(obj.service_id, obj.version)
end
# :nodoc:
- def self.list_path(opts={})
+ def self.list_path(_opts = {})
nil
end
# :nodoc:
def self.post_path
- raise "You can't POST to an setting"
+ fail "You can't POST to an setting"
end
# :nodoc:
def self.delete_path
- raise "You can't DELETE to an setting"
+ fail "You can't DELETE to an setting"
end
# :nodoc:
def delete!
- raise "You can't delete an invoice"
+ fail "You can't delete an invoice"
end
# :nodoc:
def as_hash
settings
end
end
# Get the Settings object for the specified Version
def get_settings(service, number)
- klass = Fastly::Settings
- hash = client.get(Fastly::Settings.get_path(service, number))
-
+ hash = client.get(Settings.get_path(service, number))
return nil if hash.nil?
- hash["settings"] = Hash[["general.default_host", "general.default_ttl"].collect { |var| [var, hash.delete(var)] }]
- return klass.new(hash, self)
+ hash['settings'] = Hash[['general.default_host', 'general.default_ttl'].collect { |var| [var, hash.delete(var)] }]
+ Settings.new(hash, self)
end
# Update the Settings object for the specified Version
- def update_settings(opts={})
- update(Fastly::Settings, opts)
+ def update_settings(opts = {})
+ update(Settings, opts)
end
end