state_machine

https://github.com/pluginaweek/state_machine

Ruby

Adds support for creating state machines for attributes on any Ruby class

StateMachine::BlacklistMatcher#matches?

Checks whether the given value exists outside the blacklist configured
for this matcher.

== Examples

  matcher = StateMachine::BlacklistMatcher.new([:parked, :idling])
  matcher.matches?(:parked)       # => false
  matcher.matches?(:first_gear)   # => true

Source | Google | Stack overflow

Edit

git clone [email protected]:pluginaweek/state_machine.git

cd state_machine

open lib/state_machine/matcher.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-StateMachine--BlacklistMatcher-matches--for-pr


# Commit to git

git add lib/state_machine/matcher.rbgit commit -m "better docs for StateMachine::BlacklistMatcher#matches?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-StateMachine--BlacklistMatcher-matches--for-pr

hub pull-request


# Celebrate!