class Riddler::UseCases::CompleteInteraction

Attributes

interaction_id[R]
interaction_repo[R]

Public Class Methods

new(interaction_repo:, interaction_id: @interaction_repo = interaction_repo) click to toggle source
# File lib/riddler/use_cases/complete_interaction.rb, line 6
def initialize interaction_repo:, interaction_id:
  @interaction_repo = interaction_repo
  @interaction_id = interaction_id
end

Public Instance Methods

process() click to toggle source
# File lib/riddler/use_cases/complete_interaction.rb, line 11
def process
  interaction = interaction_repo.find_by id: interaction_id
  return if interaction.nil?

  interaction.complete
  interaction_repo.update interaction
end