Class: MonkeyActionEat

Inherits:
MonkeyTimedAction show all
Defined in:
lib/MonkeyAction/monkey_action_eat.rb

Overview

Monkey action: eat (as in banana) The monkey is eating.

Constant Summary collapse

WEIGHT =
2.0
VALID_VALUES =

30 through 60 minutes

(30..60)

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) ⇒ MonkeyActionEat

Returns a new instance of MonkeyActionEat.



15
16
17
18
19
20
21
# File 'lib/MonkeyAction/monkey_action_eat.rb', line 15

def initialize(monkey, value)
  super(monkey, value, WEIGHT)

  @action_time_of_completion = @action_time + (value * 60)

  validate
end