Sha256: dc7e4c2d9256c1446ca097ad957906a89f52563dda388a760aceda8b53e93263

Contents?: true

Size: 355 Bytes

Versions: 2

Compression:

Stored size: 355 Bytes

Contents

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

  class InvalidParamsError < Exception; end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 lib/thanos/finders/finder_validator.rb
thanos-0.5.0 lib/thanos/finders/finder_validator.rb