mutations icon indicating copy to clipboard operation
mutations copied to clipboard

add TypeFilter to additional filters

Open estraph opened this issue 7 years ago • 1 comments

This PR adds a filter for inputs of a certain type. It checks the object given is of a specific type, or of a subclass of that type.

Usage example:

required do
  type :request, klass: Typhoeus::Request
end

Tests passing locally:

Raphs-MacBook-Pro:mutations raph$ git status
On branch raph/type-filter
nothing to commit, working directory clean
Raphs-MacBook-Pro:mutations raph$ rake
Run options: --seed 4892

# Running tests:

..........................................................................................................................................................................................................................

Finished tests in 0.052260s, 4171.4504 tests/s, 9337.9258 assertions/s.

218 tests, 488 assertions, 0 failures, 0 errors, 0 skips

estraph avatar Oct 22 '17 14:10 estraph

This seems to be a simpler version of the existing model filter - is there a case where you couldn't use that instead?

eugeneius avatar Oct 24 '18 20:10 eugeneius