Class: Spielbash::PressKeyAction
- Inherits:
-
BaseAction
- Object
- BaseAction
- Spielbash::PressKeyAction
- Defined in:
- lib/spielbash/model/action/press_key_action.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Attributes inherited from BaseAction
Instance Method Summary collapse
- #execute(session) ⇒ Object
-
#initialize(key, action_context) ⇒ PressKeyAction
constructor
A new instance of PressKeyAction.
Constructor Details
#initialize(key, action_context) ⇒ PressKeyAction
Returns a new instance of PressKeyAction.
5 6 7 8 |
# File 'lib/spielbash/model/action/press_key_action.rb', line 5 def initialize(key, action_context) super(action_context) @key = key end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/spielbash/model/action/press_key_action.rb', line 3 def key @key end |
Instance Method Details
#execute(session) ⇒ Object
10 11 12 |
# File 'lib/spielbash/model/action/press_key_action.rb', line 10 def execute(session) session.send_key(key) end |