lib/client_success/json_utilities.rb
def underscore(string)
      @__memoize_underscore ||= {}
      return @__memoize_underscore[string] if @__memoize_underscore[string]
      @__memoize_underscore[string] =
        string.gsub(/::/, '/')
              .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
              .gsub(/([a-z\d])([A-Z])/, '\1_\2')
              .tr('-', '_')
              .downcase
      @__memoize_underscore[string]
    end
# Returns a string in camel case.
#
Returns a string in camel case.
Returns a string in camel case .
def underscore(string)
      @__memoize_underscore ||= {}
      return @__memoize_underscore[string] if @__memoize_underscore[string]
      @__memoize_underscore[string] =
        string.gsub(/::/, '/')
              .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
              .gsub(/([a-z\d])([A-Z])/, '\1_\2')
              .tr('-', '_')
              .downcase
      @__memoize_underscore[string]
    end
def underscore ( string ) @__memoize_underscore ||= { } return @__memoize_underscore [ string ] if @__memoize_underscore [ string ] @__memoize_underscore [ string ] = string . gsub ( / :: / , '/' ) . gsub ( / ([A-Z]+)([A-Z][a-z]) / , '\1_\2' ) . gsub ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) . tr ( '-' , '_' ) . downcase @__memoize_underscore [ string ] end
Returns a string in camel case.
Returns a string in camel case .
string