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

Provides a general strategy pattern for determining whether a match is found for a value. The algorithm that actually determines the match depends on the matcher in use.

Methods

filter   new  

Attributes

values  [R]  The list of values against which queries are matched

Public Class methods

Creates a new matcher for querying against the given set of values

[Source]

    # File lib/state_machine/matcher.rb, line 12
12:     def initialize(values = [])
13:       @values = values.is_a?(Array) ? values : [values] 
14:     end

Public Instance methods

Generates a subset of values that exists in both the set of values being filtered and the values configured for the matcher

[Source]

    # File lib/state_machine/matcher.rb, line 18
18:     def filter(values)
19:       self.values & values
20:     end

[Validate]