Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/tapioca/dsl/compilers/aasm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ module Compilers
# This gem dynamically defines constants and methods at runtime. For
# example, given a class:
#
# class MyClass
# include AASM
# ~~~rb
# class MyClass
# include AASM
#
# aasm do
# state :sleeping, initial: true
# state :running, :cleaning
# aasm do
# state :sleeping, initial: true
# state :running, :cleaning
#
# event :run do
# transitions from: :sleeping, to: :running
# end
# event :run do
# transitions from: :sleeping, to: :running
# end
# end
# end
# ~~~
#
# This will result in the following constants being defined:
#
Expand Down
18 changes: 10 additions & 8 deletions manual/compiler_aasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
This gem dynamically defines constants and methods at runtime. For
example, given a class:

class MyClass
include AASM
~~~rb
class MyClass
include AASM

aasm do
state :sleeping, initial: true
state :running, :cleaning
aasm do
state :sleeping, initial: true
state :running, :cleaning

event :run do
transitions from: :sleeping, to: :running
end
event :run do
transitions from: :sleeping, to: :running
end
end
end
~~~

This will result in the following constants being defined:

Expand Down
Loading