Class: Ankit::RoundCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ankit/round_command.rb

Constant Summary

Constants inherited from Command

Command::COMMANDS

Instance Attribute Summary

Attributes inherited from Command

#args, #options, #runtime

Instance Method Summary collapse

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



10
11
12
# File 'lib/ankit/round_command.rb', line 10

def execute()
  runtime.stdout.print("#{last_round} #{next_round}\n")
end

#last_roundObject



19
20
21
22
# File 'lib/ankit/round_command.rb', line 19

def last_round
  found = Coming.existing_events(runtime).max_by(&:round)
  found ? found.round : 0
end

#next_roundObject



14
15
16
17
# File 'lib/ankit/round_command.rb', line 14

def next_round
  found = Coming.existing_events(runtime).first
  found ? found.next_round : 0
end