Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

2015-03-06から1日間の記事一覧

Rubyで状態遷移を実装できるGem「AASM」(その3_状態に入ったあとの動作を定義)

event :sence do after { p "sence"} transitions :from => :sleep, :to => :transmit end といった感じで、eventの中に記述します。 あるいは、 assmのブロック外に def comment puts "comment" endとしてあげた上で event :sence, :after => :comment do t…