mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
18 lines
224 B
Ruby
18 lines
224 B
Ruby
class SuperClass
|
|
include AASM
|
|
|
|
aasm do
|
|
state :read
|
|
state :ended
|
|
|
|
event :foo do
|
|
transitions :to => :ended, :from => [:read]
|
|
end
|
|
end
|
|
|
|
def update_state
|
|
if may_foo?
|
|
foo!
|
|
end
|
|
end
|
|
end
|