2012-12-02 02:54:58 -05:00
|
|
|
class ParametrisedEvent
|
|
|
|
include AASM
|
|
|
|
aasm do
|
|
|
|
state :sleeping, :initial => true
|
|
|
|
state :showering
|
|
|
|
state :working
|
|
|
|
state :dating
|
|
|
|
state :prettying_up
|
|
|
|
|
|
|
|
event :wakeup do
|
|
|
|
transitions :from => :sleeping, :to => [:showering, :working]
|
|
|
|
end
|
|
|
|
|
2016-10-04 10:42:15 -04:00
|
|
|
event :shower do
|
|
|
|
transitions :from => :sleeping, :to => :showering, :after => :wet_hair, :success => :wear_clothes
|
|
|
|
end
|
|
|
|
|
2012-12-02 02:54:58 -05:00
|
|
|
event :dress do
|
2015-06-18 07:32:37 -04:00
|
|
|
transitions :from => :sleeping, :to => :working, :after => :wear_clothes, :success => :wear_makeup
|
|
|
|
transitions :from => :showering, :to => [:working, :dating], :after => Proc.new { |*args| wear_clothes(*args) }, :success => proc { |*args| wear_makeup(*args) }
|
|
|
|
transitions :from => :showering, :to => :prettying_up, :after => [:condition_hair, :fix_hair], :success => [:touch_up_hair]
|
2012-12-02 02:54:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-05-05 06:16:25 -04:00
|
|
|
def wear_clothes(shirt_color, trouser_type=nil)
|
2012-12-02 02:54:58 -05:00
|
|
|
end
|
|
|
|
|
2015-06-18 07:32:37 -04:00
|
|
|
def wear_makeup(makeup, moisturizer)
|
|
|
|
end
|
|
|
|
|
2016-10-04 10:42:15 -04:00
|
|
|
def wet_hair(dryer)
|
|
|
|
end
|
|
|
|
|
2012-12-02 02:54:58 -05:00
|
|
|
def condition_hair
|
|
|
|
end
|
|
|
|
|
|
|
|
def fix_hair
|
|
|
|
end
|
2015-06-18 07:32:37 -04:00
|
|
|
|
|
|
|
def touch_up_hair
|
|
|
|
end
|
2012-12-02 02:54:58 -05:00
|
|
|
end
|