Sha256: fba207a943e52240ac069352ea862e9315b4720f17b92217865cf5903c478406

Contents?: true

Size: 323 Bytes

Versions: 37

Compression:

Stored size: 323 Bytes

Contents

class Fastly
  # Collection of frequently used utility methods
  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

37 entries across 37 versions & 1 rubygems

Version Path
fastly-3.0.2 lib/fastly/util.rb
fastly-3.0.1 lib/fastly/util.rb
fastly-3.0.0 lib/fastly/util.rb
fastly-2.5.3 lib/fastly/util.rb
fastly-2.5.2 lib/fastly/util.rb
fastly-2.5.1 lib/fastly/util.rb
fastly-2.5.0 lib/fastly/util.rb
fastly-2.4.0 lib/fastly/util.rb
fastly-2.3.1 lib/fastly/util.rb
fastly-2.3.0 lib/fastly/util.rb
fastly-2.2.0 lib/fastly/util.rb
fastly-2.1.0 lib/fastly/util.rb
fastly-2.0.0 lib/fastly/util.rb
fastly-1.15.0 lib/fastly/util.rb
fastly-1.14.0 lib/fastly/util.rb
fastly-1.13.2 lib/fastly/util.rb
fastly-1.13.1 lib/fastly/util.rb
fastly-1.13.0 lib/fastly/util.rb
fastly-1.12.0 lib/fastly/util.rb
fastly-1.11.0 lib/fastly/util.rb