Class: Spielbash::PressKeyAction

Inherits:
BaseAction show all
Defined in:
lib/spielbash/model/action/press_key_action.rb

Instance Attribute Summary collapse

Attributes inherited from BaseAction

#action_context

Instance Method Summary collapse

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

#keyObject

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