2012-10-26 04:44:56 -04:00
|
|
|
class CallbackOldDsl
|
|
|
|
include AASM
|
|
|
|
|
|
|
|
aasm_initial_state :open
|
|
|
|
aasm_state :open,
|
|
|
|
:before_enter => :before_enter_open,
|
2012-12-02 02:51:48 -05:00
|
|
|
:after_enter => :after_enter_open,
|
|
|
|
:before_exit => :before_exit_open,
|
|
|
|
:exit => :exit_open,
|
|
|
|
:after_exit => :after_exit_open
|
2012-10-26 04:44:56 -04:00
|
|
|
aasm_state :closed,
|
|
|
|
:before_enter => :before_enter_closed,
|
2012-12-02 02:51:48 -05:00
|
|
|
:enter => :enter_closed,
|
|
|
|
:after_enter => :after_enter_closed,
|
|
|
|
:before_exit => :before_exit_closed,
|
|
|
|
:after_exit => :after_exit_closed
|
2012-10-26 04:44:56 -04:00
|
|
|
|
|
|
|
aasm_event :close, :before => :before, :after => :after do
|
|
|
|
transitions :to => :closed, :from => [:open]
|
|
|
|
end
|
|
|
|
|
|
|
|
aasm_event :open, :before => :before, :after => :after do
|
|
|
|
transitions :to => :open, :from => :closed
|
|
|
|
end
|
|
|
|
|
|
|
|
def before_enter_open; end
|
|
|
|
def before_exit_open; end
|
|
|
|
def after_enter_open; end
|
|
|
|
def after_exit_open; end
|
|
|
|
|
|
|
|
def before_enter_closed; end
|
|
|
|
def before_exit_closed; end
|
|
|
|
def after_enter_closed; end
|
|
|
|
def after_exit_closed; end
|
|
|
|
|
|
|
|
def before; end
|
|
|
|
def after; end
|
2012-12-02 02:51:48 -05:00
|
|
|
|
|
|
|
def enter_closed; end
|
|
|
|
def exit_open; end
|
2012-10-26 04:44:56 -04:00
|
|
|
end
|