From dcf100185775abad71606e93cb00663e5570b561 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Thu, 7 Jun 2012 09:36:41 +0900 Subject: update camel to allow lower case first letter optionally --- lib/axlsx.rb | 5 +++-- 1 file 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 -- cgit v1.2.3