lib/intact_case/modules.rb
def camelize(delimiter = '_')
          d = Regexp.escape(delimiter)

          camel_head    = "^([a-z]{2,}#{d})(?:#{d}|$)"  # can not use (?![a-z]) because (?:)
          capitalize    = "(?<=#{d})([a-z])"
          rear_acronym  = "(?!^)([a-z]+)#{d}(?![a-z])"
          cut_delimiter = "(?<=^|[a-z]{2})#{d}|#{d}(?=[a-z]{2,}(?:#{d}[a-z]|$))"

          cases_pattern = /#{camel_head}|#{capitalize}|#{rear_acronym}|#{cut_delimiter}/
          self.gsub(cases_pattern) { "#{$1}" + "#{$2}#{$3}".upcase }
        end
#
# Convert compound words to camelCase from delimiterized.
#
# @author StewEucen
# @example delimiterized to camelCase.
#   'snake_case'.camelize         #=> 'snakeCase'
#   'get_utc__day'.camelize       #=> 'getUTCDay'
#   'ui__view'.camelize           #=> 'ui_View'
#   'xml__html__request'.camelize #=> 'xml_HTMLRequest'
# @param  [string] delimiter Delimiter.
# @return [string] camelCase String.
# @since  Release 1.0.0
#
Convert compound words to camelCase from delimiterized.
Convert compound words to camelCase from delimiterized .
def camelize(delimiter = '_')
          d = Regexp.escape(delimiter)
          camel_head    = "^([a-z]{2,}#{d})(?:#{d}|$)"  
          capitalize    = "(?<=#{d})([a-z])"
          rear_acronym  = "(?!^)([a-z]+)#{d}(?![a-z])"
          cut_delimiter = "(?<=^|[a-z]{2})#{d}|#{d}(?=[a-z]{2,}(?:#{d}[a-z]|$))"
          cases_pattern = /#{camel_head}|#{capitalize}|#{rear_acronym}|#{cut_delimiter}/
          self.gsub(cases_pattern) { "#{$1}" + "#{$2}#{$3}".upcase }
        end
def camelize ( delimiter = '_' ) d = Regexp . escape ( delimiter ) camel_head = "^([a-z]{2,}#{d})(?:#{d}|$)" capitalize = "(?<=#{d})([a-z])" rear_acronym = "(?!^)([a-z]+)#{d}(?![a-z])" cut_delimiter = "(?<=^|[a-z]{2})#{d}|#{d}(?=[a-z]{2,}(?:#{d}[a-z]|$))" cases_pattern = / #{ camel_head } | #{ capitalize } | #{ rear_acronym } | #{ cut_delimiter } / self . gsub ( cases_pattern ) { "#{$1}" + "#{$2}#{$3}" . upcase } end
Convert compound words to camelCase from delimiterized.
Convert compound words to camelCase from delimiterized .
# can not use (?![a-z]) because (?:)
None
string
delimiter
None
author
None
example
delimiterized to camelCase.
delimiterized to camelCase .
since
None