Module: Stateflow

Defined in:
lib/stateflow.rb,
lib/stateflow/event.rb,
lib/stateflow/state.rb,
lib/stateflow/machine.rb,
lib/stateflow/exception.rb,
lib/stateflow/transition.rb,
lib/stateflow/persistence.rb,
lib/stateflow/persistence/none.rb,
lib/stateflow/persistence/mongoid.rb,
lib/stateflow/persistence/mongo_mapper.rb,
lib/stateflow/persistence/active_record.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, Persistence Classes: Event, IncorrectTransition, Machine, NoEventFound, NoStateFound, NoTransitionFound, State, Transition

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
# File 'lib/stateflow.rb', line 2

def self.included(base)
  base.send :include, InstanceMethods
  base.extend ClassMethods
  Stateflow::Persistence.set(base)
end

.persistenceObject



8
9
10
# File 'lib/stateflow.rb', line 8

def self.persistence
  @@persistence ||= :active_record
end

.persistence=(persistence) ⇒ Object



12
13
14
# File 'lib/stateflow.rb', line 12

def self.persistence=(persistence)
  @@persistence = persistence
end