Class StateMachine::AllMatcher
In: lib/state_machine/matcher.rb
Parent: Matcher

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

Methods

-   description   filter   matches?  

Included Modules

Singleton

Public Instance methods

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

[Source]

    # File lib/state_machine/matcher.rb, line 35
35:     def -(blacklist)
36:       BlacklistMatcher.new(blacklist)
37:     end

A human-readable description of this matcher. Always "all".

[Source]

    # File lib/state_machine/matcher.rb, line 50
50:     def description
51:       'all'
52:     end

Always returns the given set of values

[Source]

    # File lib/state_machine/matcher.rb, line 45
45:     def filter(values)
46:       values
47:     end

Always returns true

[Source]

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

[Validate]