mutations
mutations copied to clipboard
add TypeFilter to additional filters
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
This seems to be a simpler version of the existing model filter - is there a case where you couldn't use that instead?