16 lines
352 B
Ruby
16 lines
352 B
Ruby
module Scoring
|
|
class ApplyAction
|
|
Result = Struct.new(:score, :set_won, :match_won, :winner, keyword_init: true)
|
|
|
|
def initialize(session:, action:)
|
|
@session = session
|
|
@match = session.match
|
|
@action = action.to_s
|
|
end
|
|
|
|
def call
|
|
Engine.for_match(@match).apply(session: @session, action: @action)
|
|
end
|
|
end
|
|
end
|