Matches everything but a specific set of values
A human-readable description of this matcher
# File lib/state_machine/matcher.rb, line 96 def description "all - #{values.length == 1 ? values.first.inspect : values.inspect}" end
Finds all values that are not within the blacklist configured for this matcher
# File lib/state_machine/matcher.rb, line 91 def filter(values) values - self.values end
Checks whether the given value exists outside the blacklist configured for this matcher.
matcher = StateMachine::BlacklistMatcher.new([:parked, :idling]) matcher.matches?(:parked) # => false matcher.matches?(:first_gear) # => true
# File lib/state_machine/matcher.rb, line 85 def matches?(value, context = {}) !values.include?(value) end
Generated with the Darkfish Rdoc Generator 2.