Skip to content

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