Class: Control::Transition
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Control::Transition
- Defined in:
- lib/control/transition.rb
Instance Method Summary collapse
-
#from ⇒ Object
Get source state for transition.
-
#to ⇒ Object
Get destination state for transition.
-
#to_s ⇒ String
Pretty print a transition.
-
#workflow ⇒ Object
Get workflow.
Instance Method Details
#from ⇒ Object
Get source state for transition
49 50 51 |
# File 'lib/control/transition.rb', line 49 def from Kernel.qualified_const_get(from_class).find(from_id) unless from_class.blank? end |
#to ⇒ Object
Get destination state for transition
43 44 45 |
# File 'lib/control/transition.rb', line 43 def to Kernel.qualified_const_get(to_class).find(to_id) end |
#to_s ⇒ String
Pretty print a transition
31 32 33 |
# File 'lib/control/transition.rb', line 31 def to_s "Workflow: #{workflow_class} || #{created_at} #{from_class} -> #{to_class}" end |
#workflow ⇒ Object
Get workflow
37 38 39 |
# File 'lib/control/transition.rb', line 37 def workflow Kernel.qualified_const_get(workflow_class).find(workflow_id) end |