Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ruby add dynamic events using AASM
- # game.rb
- class Game
- include AASM
- aasm_initial_state :start
- end
- # add the require after the class definition, else it will complain of a missing constant
- require "other_file"
- # other_file.rb
- Game.aasm_state :another_state
- Game.aasm_event do
- transitions :to => :another_state, :from => [:start]
- end
Add Comment
Please, Sign In to add comment