Module: Control::Workflow::ClassMethods
- Defined in:
- lib/control/workflow.rb
Instance Method Summary collapse
-
#is_workflow? ⇒ Boolean
Checks if class is a workflow.
-
#states ⇒ Array<Class>
Get all state classes associated to this workflow.
Instance Method Details
#is_workflow? ⇒ Boolean
Checks if class is a workflow
10 11 12 |
# File 'lib/control/workflow.rb', line 10 def is_workflow? true end |
#states ⇒ Array<Class>
Get all state classes associated to this workflow
16 17 18 19 20 21 22 23 |
# File 'lib/control/workflow.rb', line 16 def states reflect_on_all_associations.each.map do |a| klass = Kernel.qualified_const_get(a.class_name.to_s.classify) if klass.respond_to?(:is_state?) and klass.is_state? klass end end end |