Method: Axlsx.camel

Defined in:
lib/axlsx.rb

.camel(s = "", all_caps = true) ⇒ String

performs the increadible feat of changing snake_case to CamelCase

Parameters:

  • s (String) (defaults to: "")

    The snake case string to camelize

Returns:

  • (String)


124
125
126
127
128
# File 'lib/axlsx.rb', line 124

def self.camel(s="", all_caps = true)
  s = s.to_s
  s = s.capitalize if all_caps
  s.gsub(/_(.)/){ $1.upcase }
end