Class: Command::InputMiddleware::RailsParams

Inherits:
Object
  • Object
show all
Defined in:
lib/command/input_middleware/rails_params.rb

Class Method Summary collapse

Class Method Details

.call(inputs) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/command/input_middleware/rails_params.rb', line 6

def self.call(inputs)
  class_name = 'ActionController::Parameters'
  klass = class_name.safe_constantize

  return inputs unless klass && inputs.is_a?(klass)

  inputs.to_unsafe_h.to_h
end