Sha256: c9a84ee773b359d54d8888ffcef5eb8bdbf34ae6379746948c8a6d9f902b77b3

Contents?: true

Size: 273 Bytes

Versions: 3

Compression:

Stored size: 273 Bytes

Contents

class Fastly
  module Util
    def self.class_to_path(klass, append_s = false)
      klass_string = klass.to_s.split('::')[-1]
      klass_string = klass_string.gsub(/([^A-Z])([A-Z]+)/, '\1_\2').downcase
      append_s ? "#{klass_string}s" : klass_string
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastly-1.1.4 lib/fastly/util.rb
fastly-1.1.3 lib/fastly/util.rb
fastly-1.1.2 lib/fastly/util.rb