Skip to content

Instantly share code, notes, and snippets.

@soulcutter
Created April 24, 2014 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soulcutter/11265440 to your computer and use it in GitHub Desktop.
Save soulcutter/11265440 to your computer and use it in GitHub Desktop.
Proposal for ExclusionFilters
class ExclusionRules < FilterRules
CONDITIONAL_FILTERS = {
:if => lambda { |value| !value },
:unless => lambda { |value| value }
}.freeze
def include_example?(example)
example.any_apply?(@rules) || example.any_apply?(CONDITIONAL_FILTERS)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment