Class: Ankit::ChallengeCommand

Inherits:
Command
  • Object
show all
Includes:
Challenge, Ankit::Challenge::Approaching, Coming, Finding, RoundCounting
Defined in:
lib/ankit/challenge_command.rb

Constant Summary

Constants inherited from Command

Ankit::Command::COMMANDS

Instance Attribute Summary

Attributes inherited from Command

#args, #options, #runtime

Instance Method Summary collapse

Methods included from Ankit::Challenge::Approaching

#initial_state

Methods included from RoundCounting

#last_round, #latest_round, #next_round, #round_proceeded

Methods included from Coming

coming_events, coming_paths, existing_events

Methods included from Finding

#find_paths

Methods inherited from Command

available, by_name, command_name, define_options, #initialize, option_spec

Constructor Details

This class inherits a constructor from Ankit::Command

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/ankit/challenge_command.rb', line 18

def execute()
  Signal.trap("INT") do
    runtime.clear_screen
    STDERR.print("Quit.\n")
    exit(0)
  end

  initial_state.keep_pumping_until { |state| state.over? }
  Signal.trap("INT", "DEFAULT")
end

#sessionObject



16
# File 'lib/ankit/challenge_command.rb', line 16

def session; @session ||= Challenge::Session.make(runtime, coming_limit); end