Start implementing match start

This commit is contained in:
Daniel Schädler 2019-05-08 21:24:19 +02:00
parent b51f9ca382
commit a990645f8f
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
class StartMatch
include Interactor
def call
match = context.match
begin
match = MatchService.start_match(match)
context.object_to_save = match
rescue StandardError
context.fail!
end
end
end

View File

@ -1,6 +1,12 @@
# frozen_string_literal: true
class MatchService
# Starts a Match; setting its state to running
#
# @param match Match the Match to be started
# @return Match the resulting Match
def self.start_match(match); end
# Generates all necessary matches from a list of teams
#
# @param teams [Array] the teams to generate matches with