summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-06-07 09:36:41 +0900
committerRandy Morgan <[email protected]>2012-06-07 09:36:41 +0900
commitdcf100185775abad71606e93cb00663e5570b561 (patch)
tree2b95fd3422d988cf89f25943b2b253f75ebc35c7
parent70bf38b72a42b25976f750ff86e7521c356c157e (diff)
downloadcaxlsx-dcf100185775abad71606e93cb00663e5570b561.tar.gz
caxlsx-dcf100185775abad71606e93cb00663e5570b561.zip
update camel to allow lower case first letter optionally
-rw-r--r--lib/axlsx.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index 92c58b33..54c0ff2c 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -87,8 +87,9 @@ module Axlsx
# performs the increadible feat of changing snake_case to CamelCase
# @param [String] s The snake case string to camelize
# @return [String]
- def self.camel(s="")
- s = s.capitalize.gsub(/_(.)/){ $1.upcase }
+ def self.camel(s="", all_caps = true)
+ s = s.capitalize if all_caps
+ s.gsub(/_(.)/){ $1.upcase }
end
end