class UpdateService
  PLATFORM_SERVICES = {
    "tic80"      => "SoftwareUpdater::Tic80Service",
    "ebitengine" => "SoftwareUpdater::EbitengineService",
    "love"       => "SoftwareUpdater::LoveService"
  }.freeze

  def update(input)
    service_class = PLATFORM_SERVICES[input.platform]
    raise ArgumentError, "Unsupported platform: #{input.platform}" unless service_class
    service_class.constantize.new.update(input.name, input.version)
  end
end
