Class: MonkeyActionSleep

Inherits:
MonkeyTimedAction show all
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

#action_time_of_completion

Attributes inherited from MonkeyAction

#monkey

Attributes inherited from Action

#action_completed, #action_time, #value, #weight

Instance Method Summary collapse

Methods inherited from Action

#action_completed?

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