lib/evertils/helpers/formatting.rb in evertils-2.0.2 vs lib/evertils/helpers/formatting.rb in evertils-2.1.0
- old
+ new
@@ -16,8 +16,23 @@
:Monthly => "Monthly Log [#{current_date.strftime('%B %Y')}]",
:Deployments => "#{current_date.strftime('%B %-d')} - #{week_stub}",
:'Priority Queue' => "Queue For [#{current_date.strftime('%B %-d')} - #{week_stub}]"
}
end
+
+ def self.symbolize_keys(hash)
+ hash.inject({}){ |result, (key, value)|
+ new_key = case key
+ when String then key.to_sym
+ else key
+ end
+ new_value = case value
+ when Hash then symbolize_keys(value)
+ else value
+ end
+ result[new_key] = new_value
+ result
+ }
+ end
end
end
end