Class: Spielbash::NewEnvironmentAction
- Inherits:
-
BaseAction
- Object
- BaseAction
- Spielbash::NewEnvironmentAction
- Defined in:
- lib/spielbash/model/action/new_environment_action.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#wait_check_cmd ⇒ Object
Returns the value of attribute wait_check_cmd.
Attributes inherited from BaseAction
Instance Method Summary collapse
- #execute(session) ⇒ Object
-
#initialize(command, wait_check_cmd, root_context) ⇒ NewEnvironmentAction
constructor
A new instance of NewEnvironmentAction.
Constructor Details
#initialize(command, wait_check_cmd, root_context) ⇒ NewEnvironmentAction
Returns a new instance of NewEnvironmentAction.
5 6 7 8 9 |
# File 'lib/spielbash/model/action/new_environment_action.rb', line 5 def initialize(command, wait_check_cmd, root_context) super(root_context) @command = command @wait_check_cmd = wait_check_cmd end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/spielbash/model/action/new_environment_action.rb', line 3 def command @command end |
#wait_check_cmd ⇒ Object
Returns the value of attribute wait_check_cmd.
3 4 5 |
# File 'lib/spielbash/model/action/new_environment_action.rb', line 3 def wait_check_cmd @wait_check_cmd end |
Instance Method Details
#execute(session) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/spielbash/model/action/new_environment_action.rb', line 11 def execute(session) command.each_char do |c| session.send_key(c) sleep(action_context.typing_delay_s) end session.send_key('C-m') sleep(action_context.reading_delay_s) action_context.wait_check_cmd = wait_check_cmd end |