Matches a specific set of values
A human-readable description of this matcher
# File lib/state_machine/matcher.rb, line 70 def description values.length == 1 ? values.first.inspect : values.inspect end
Checks whether the given value exists within the whitelist configured for this matcher.
matcher = StateMachine::WhitelistMatcher.new([:parked, :idling]) matcher.matches?(:parked) # => true matcher.matches?(:first_gear) # => false
# File lib/state_machine/matcher.rb, line 65 def matches?(value, context = {}) values.include?(value) end
Generated with the Darkfish Rdoc Generator 2.