Maintain is a simple state machine mixin for Ruby objects. It supports comparisons, bitmasks, and hooks that really work. It can be used for multiple attributes and will always do its best to stay out of your way and let your code drive the machine, and not vice versa.
Gemfile gem 'maintain', '~> 0.3.0'
install gem install maintain