Class: CryptReboot::Cli::Params::Flattener
- Inherits:
-
Object
- Object
- CryptReboot::Cli::Params::Flattener
- Defined in:
- lib/crypt_reboot/cli/params/flattener.rb
Overview
Replace given key in params with new keys obtained from its contents with suffixes added
Instance Method Summary collapse
Instance Method Details
#call(params) ⇒ Object
8 9 10 11 |
# File 'lib/crypt_reboot/cli/params/flattener.rb', line 8 def call(params) paths = params.fetch(key, {}).transform_keys { |k| :"#{k}#{suffix}" } params.reject { |k, _| k == key }.merge(paths) end |