Class: MonkeyActionSleep
- Inherits:
-
MonkeyTimedAction
- Object
- Action
- MonkeyAction
- MonkeyTimedAction
- MonkeyActionSleep
- Defined in:
- lib/MonkeyAction/monkey_action_sleep.rb
Overview
Monkey action: sleep (as in take a snooze) The monkey is a sleep.
Constant Summary collapse
- WEIGHT =
10.0
- VALID_VALUES =
6 through 8 hours
((60 * 6)..(60 * 8))
Instance Attribute Summary
Attributes inherited from MonkeyTimedAction
Attributes inherited from MonkeyAction
Attributes inherited from Action
#action_completed, #action_time, #value, #weight
Instance Method Summary collapse
-
#initialize(monkey, value) ⇒ MonkeyActionSleep
constructor
A new instance of MonkeyActionSleep.
Methods inherited from Action
Constructor Details
#initialize(monkey, value) ⇒ MonkeyActionSleep
Returns a new instance of MonkeyActionSleep.
15 16 17 18 19 20 21 |
# File 'lib/MonkeyAction/monkey_action_sleep.rb', line 15 def initialize(monkey, value) super(monkey, value, WEIGHT) @action_time_of_completion = @action_time + (value * (60 * 60)) validate end |