class StateMachine::AllMatcher

Matches any given value. Since there is no configuration for this type of matcher, it must be used as a singleton.

Public Instance Methods

-(blacklist) click to toggle source

Generates a blacklist matcher based on the given set of values

Examples

matcher = StateMachine::AllMatcher.instance - [:parked, :idling]
matcher.matches?(:parked)       # => false
matcher.matches?(:first_gear)   # => true
   # File lib/state_machine/matcher.rb
35 def -(blacklist)
36   BlacklistMatcher.new(blacklist)
37 end
description() click to toggle source

A human-readable description of this matcher. Always “all”.

   # File lib/state_machine/matcher.rb
50 def description
51   'all'
52 end
filter(values) click to toggle source

Always returns the given set of values

   # File lib/state_machine/matcher.rb
45 def filter(values)
46   values
47 end
matches?(value, context = {}) click to toggle source

Always returns true

   # File lib/state_machine/matcher.rb
40 def matches?(value, context = {})
41   true
42 end