Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TypeFilter to additional filters #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

estraph
Copy link

@estraph estraph commented Oct 22, 2017

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 PR adds a filter for object inputs of a certain type.
@eugeneius
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants