class Spielbash::NewEnvironmentAction

Attributes

command[RW]
wait_check_cmd[RW]

Public Class Methods

new(command, wait_check_cmd, root_context) click to toggle source
Calls superclass method Spielbash::BaseAction::new
# 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

Public Instance Methods

execute(session) click to toggle source
# 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