Module: TLAW::Util

Defined in:
lib/tlaw/util.rb

Defined Under Namespace

Classes: Description

Class Method Summary collapse

Class Method Details

.camelize(string) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/tlaw/util.rb', line 5

def camelize(string)
  string
    .sub(/^[a-z\d]*/, &:capitalize)
    .gsub(%r{(?:_|(/))([a-z\d]*)}i) {
      "#{$1}#{$2.capitalize}" # rubocop:disable Style/PerlBackrefs
    }
end