Sha256: 2654e4f9d20429ca6cf7c3db2aeae87d311d34c588b24aa6adaab4160347992e
Contents?: true
Size: 793 Bytes
Versions: 27
Compression:
Stored size: 793 Bytes
Contents
module ZendeskAPI # @private module Helpers # From https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/modulize.rb def self.modulize_string(string) # gsub('__','/'). # why was this ever here? string.gsub(/__(.?)/) { "::#{$1.upcase}" }. gsub(/\/(.?)/) { "::#{$1.upcase}" }. gsub(/(?:_+|-+)([a-z])/) { $1.upcase }. gsub(/(\A|\s)([a-z])/) { $1 + $2.upcase } end # From https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/snakecase.rb def self.snakecase_string(string) # gsub(/::/, '/'). string.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). gsub(/([a-z\d])([A-Z])/, '\1_\2'). tr('-', '_'). gsub(/\s/, '_'). gsub(/__+/, '_'). downcase end end end
Version data entries
27 entries across 27 versions & 2 rubygems