Sha256: a1bb116572a24fa3b1dbc14a24fd80b73c3646948a5f4ad250b9b1c60db816a5

Contents?: true

Size: 304 Bytes

Versions: 12

Compression:

Stored size: 304 Bytes

Contents

module Contentful
  # Utility methods used by the contentful gem
  module Support
    class << self
      # Transforms CamelCase into snake_case (taken from zucker)
      def snakify(object)
        snake = String(object).gsub(/(?<!^)[A-Z]/) { "_#$&" }
        snake.downcase
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
contentful-0.8.0 lib/contentful/support.rb
contentful-0.7.0 lib/contentful/support.rb
contentful-0.6.0 lib/contentful/support.rb
contentful-0.5.0 lib/contentful/support.rb
contentful-0.4.0 lib/contentful/support.rb
contentful-0.3.5 lib/contentful/support.rb
contentful-0.3.4 lib/contentful/support.rb
contentful-0.3.3 lib/contentful/support.rb
contentful-0.3.2 lib/contentful/support.rb
contentful-0.3.1 lib/contentful/support.rb
contentful-0.3.0 lib/contentful/support.rb
contentful-0.2.0 lib/contentful/support.rb