Class: Clowne::Utils::Params::KeyProxy

Inherits:
BaseProxy
  • Object
show all
Defined in:
lib/clowne/utils/params.rb

Instance Attribute Summary

Attributes inherited from BaseProxy

#value

Instance Method Summary collapse

Methods inherited from BaseProxy

#initialize

Constructor Details

This class inherits a constructor from Clowne::Utils::Params::BaseProxy

Instance Method Details

#permit(params:) ⇒ Object

Raises:

  • (KeyError)


41
42
43
44
45
46
# File 'lib/clowne/utils/params.rb', line 41

def permit(params:, **)
  nested_params = params.fetch(value)
  return nested_params if nested_params.is_a?(Hash)

  raise KeyError, "value by key '#{value}' must be a Hash"
end