No commit activity in last 3 years
No release in over 3 years
A minimal, trivial, deadly simple state machine for Mongoid
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

~> 4.2.0
 Project Readme

pretends_like_state_machine

Build Status Code Climate Dependency Status Coverage Status

A minimal, trivial, deadly simple state machine for Mongoid :)

Installation

Add to your Gemfile:

gem 'pretends_like_state_machine', '~> 0.0.2'

Example

Just add the macro pretends_like_state_machine and provide a list of the valid states.

Declaration:

class Processing
  include Mongoid::Document

  pretends_like_state_machine states: [:waiting, :processing, :processed]
end

Usage:

processing = Processing.create
processing.waiting!
=> true
processing.waiting?
=> true

License

MIT License. Copyright 2012-2014 @nosolopau.