36 lines
627 B
Ruby
36 lines
627 B
Ruby
![]() |
class FooMultiple
|
||
|
include AASM
|
||
|
aasm(:left) do
|
||
|
state :open, :initial => true, :before_exit => :before_exit
|
||
|
state :closed, :before_enter => :before_enter
|
||
|
state :final
|
||
|
|
||
|
event :close, :success => :success_callback do
|
||
|
transitions :from => [:open], :to => [:closed]
|
||
|
end
|
||
|
|
||
|
event :null do
|
||
|
transitions :from => [:open], :to => [:closed, :final], :guard => :always_false
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def always_false
|
||
|
false
|
||
|
end
|
||
|
|
||
|
def success_callback
|
||
|
end
|
||
|
|
||
|
def before_enter
|
||
|
end
|
||
|
def before_exit
|
||
|
end
|
||
|
end
|
||
|
|
||
|
class FooTwoMultiple < FooMultiple
|
||
|
include AASM
|
||
|
aasm(:left) do
|
||
|
state :foo
|
||
|
end
|
||
|
end
|