lib/fastly.rb in fastly-1.1.1 vs lib/fastly.rb in fastly-1.1.2
- old
+ new
@@ -3,11 +3,11 @@
# License:: Distributes under the same terms as Ruby
# A client library for interacting with the Fastly web acceleration service
class Fastly
require 'fastly/gem_version'
- require 'fastly/string'
+ require 'fastly/util'
require 'fastly/fetcher'
require 'fastly/client'
require 'fastly/base'
require 'fastly/belongs_to_service_and_version'
@@ -153,10 +153,10 @@
def regions
client.get_stats("/stats/regions")
end
[User, Customer, Backend, CacheSetting, Condition, Director, Domain, Header, Healthcheck, Gzip, Match, Origin, RequestSetting, ResponseObject, Service, S3Logging, Syslog, VCL, Version].each do |klass|
- type = klass.to_s.split("::")[-1].underscore
+ type = Util.class_to_path(klass)
# unless the class doesn't have a list path or it already exists
unless klass.list_path.nil? || klass.respond_to?("list_#{type}s".to_sym)
self.send :define_method, "list_#{type}s".to_sym do |*args|
list(klass, *args)
end