Start implementing match start
This commit is contained in:
parent
b51f9ca382
commit
a990645f8f
|
|
@ -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
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MatchService
|
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
|
# Generates all necessary matches from a list of teams
|
||||||
#
|
#
|
||||||
# @param teams [Array] the teams to generate matches with
|
# @param teams [Array] the teams to generate matches with
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue