state_machine

https://github.com/pluginaweek/state_machine

Ruby

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

StateMachine::Integrations.find_by_name

Finds an integration with the given name.  If the integration cannot be
found, then a NameError exception will be raised.

== Examples

  StateMachine::Integrations.find_by_name(:active_record) # => StateMachine::Integrations::ActiveRecord
  StateMachine::Integrations.find_by_name(:active_model)  # => StateMachine::Integrations::ActiveModel
  StateMachine::Integrations.find_by_name(:data_mapper)   # => StateMachine::Integrations::DataMapper
  StateMachine::Integrations.find_by_name(:mongoid)       # => StateMachine::Integrations::Mongoid
  StateMachine::Integrations.find_by_name(:mongo_mapper)  # => StateMachine::Integrations::MongoMapper
  StateMachine::Integrations.find_by_name(:sequel)        # => StateMachine::Integrations::Sequel
  StateMachine::Integrations.find_by_name(:invalid)       # => StateMachine::IntegrationNotFound: :invalid is an invalid integration

Source | Google | Stack overflow

Edit

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

cd state_machine

open lib/state_machine/integrations.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-StateMachine--Integrations-find_by_name-for-pr


# Commit to git

git add lib/state_machine/integrations.rbgit commit -m "better docs for StateMachine::Integrations.find_by_name"


# 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--Integrations-find_by_name-for-pr

hub pull-request


# Celebrate!