Guest User

Untitled

a guest
Aug 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Ruby add dynamic events using AASM
  2. # game.rb
  3. class Game
  4. include AASM
  5.  
  6. aasm_initial_state :start
  7. end
  8.  
  9. # add the require after the class definition, else it will complain of a missing constant
  10. require "other_file"
  11.  
  12. # other_file.rb
  13. Game.aasm_state :another_state
  14. Game.aasm_event do
  15. transitions :to => :another_state, :from => [:start]
  16. end
Add Comment
Please, Sign In to add comment