Module: Jackal::Cfn::Utils
- Defined in:
- lib/jackal-cfn/utils.rb,
lib/jackal-cfn/utils/fog.rb,
lib/jackal-cfn/utils/http.rb
Defined Under Namespace
Instance Method Summary collapse
-
#snakecase(v) ⇒ Symbol
Snake case string.
-
#transform_parameters(params) ⇒ Hash
(also: #rekey_hash)
Snake case top level keys in hash.
Instance Method Details
#snakecase(v) ⇒ Symbol
Snake case string
27 28 29 |
# File 'lib/jackal-cfn/utils.rb', line 27 def snakecase(v) Bogo::Utility.snake(v) end |
#transform_parameters(params) ⇒ Hash Also known as: rekey_hash
Snake case top level keys in hash
14 15 16 17 18 19 20 |
# File 'lib/jackal-cfn/utils.rb', line 14 def transform_parameters(params) Smash.new.tap do |new_hash| (params || []).each do |key, value| new_hash[snakecase(key)] = value end end end |