Module: K8s::Config::KeyTransformations
- Included in:
- K8s::Config, Child
- Defined in:
- lib/k8s/config.rb
Instance Method Summary collapse
Instance Method Details
#initialize(hash = self.class.defaults, args = {}) ⇒ Object
18 19 20 |
# File 'lib/k8s/config.rb', line 18 def initialize(hash = self.class.defaults, args = {}) super(hash.to_h.transform_keys { |k| k.to_s.tr('-', '_').to_sym }, args.merge(recurse_over_arrays: true)) end |
#to_h ⇒ Object
22 23 24 |
# File 'lib/k8s/config.rb', line 22 def to_h super.transform_keys { |k| k.to_s.tr('_', '-').to_sym } end |