Module: Octiron::Support::CamelCase

Included in:
Identifiers
Defined in:
lib/octiron/support/camel_case.rb

Overview

See Also:

  • CamelCase::camel_case

Instance Method Summary collapse

Instance Method Details

#camel_case(underscored_name) ⇒ String

Takes an underscored name and turns it into a CamelCase String

Parameters:

  • underscored_name (String, Symbol)

    the underscored name to turn into camel case.

Returns:

  • (String)

    CamelCased version of the underscored_name



20
21
22
23
24
# File 'lib/octiron/support/camel_case.rb', line 20

def camel_case(underscored_name)
  return underscored_name.to_s.split("_").map do |word|
    word.upcase[0] + word[1..-1]
  end.join
end