Class: Thanos::FinderValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/thanos/finders/finder_validator.rb

Class Method Summary collapse

Class Method Details

.validate(params, allowed_params) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/thanos/finders/finder_validator.rb', line 4

def validate(params, allowed_params)
  not_allowed = params.keys - allowed_params
  unless not_allowed.empty?
    raise InvalidParamsError, "Invalid parameters: #{not_allowed}"
  end
  true
end