Module: CarrotRpc::Format
- Defined in:
- lib/carrot_rpc/format.rb
Overview
Used to format keys
Class Method Summary collapse
-
.keys(format, data) ⇒ Hash
Logic to process the renaming of keys in a hash.
Class Method Details
.keys(format, data) ⇒ Hash
Logic to process the renaming of keys in a hash.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/carrot_rpc/format.rb', line 11 def self.keys(format, data) case format when :dasherize data.rename_keys("_", "-") when :underscore data.rename_keys("-", "_") when :none data else data end end |