Class: MonkeyActionType
- Inherits:
-
MonkeyAction
- Object
- Action
- MonkeyAction
- MonkeyActionType
- Defined in:
- lib/MonkeyAction/monkey_action_type.rb
Overview
Monkey action: type (as in keyboard) The monkey typed something on the keyboard.
Constant Summary collapse
- WEIGHT =
5.0
Instance Attribute Summary collapse
-
#keyboard_input ⇒ Object
readonly
Returns the value of attribute keyboard_input.
Attributes inherited from MonkeyAction
Attributes inherited from Action
#action_completed, #action_time, #value, #weight
Instance Method Summary collapse
-
#initialize(monkey, keyboard_input) ⇒ MonkeyActionType
constructor
A new instance of MonkeyActionType.
Methods inherited from Action
Constructor Details
#initialize(monkey, keyboard_input) ⇒ MonkeyActionType
Returns a new instance of MonkeyActionType.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/MonkeyAction/monkey_action_type.rb', line 13 def initialize(monkey, keyboard_input) raise MonkeyEngine::Exceptions::NilArgumentException, "keyboard_input '#{keyboard_input}' cannot be nil" \ if keyboard_input.nil? unless keyboard_input.is_a?(KeyboardInput) raise MonkeyEngine::Exceptions::InvalidArgumentTypeException, "keyboard_input '#{keyboard_input}' is not a valid argument type" end @keyboard_input = keyboard_input super(monkey, @keyboard_input.input, WEIGHT) validate end |
Instance Attribute Details
#keyboard_input ⇒ Object (readonly)
Returns the value of attribute keyboard_input.
9 10 11 |
# File 'lib/MonkeyAction/monkey_action_type.rb', line 9 def keyboard_input @keyboard_input end |