trusona/trusona-server-sdk-ruby

View on GitHub
lib/trusona/services/tru_codes_service.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
91%
# frozen_string_literal: true

module Trusona
  module Services
    #
    ## A service for interacting with TruCode TruCodes
    class TruCodesService < BaseService
      def initialize(
        client: Trusona::Api::HTTPClient.new(Trusona.config.api_host),
        mapper: Trusona::Mappers::TruCodeMapper.new
      )
        super(client:, mapper:)
        @client = client
        @mapper = mapper
        @resource_path = '/api/v2/trucodes'
      end

      def member_path(resource)
        [@resource_path, resource.id].join('/')
      end

      def verify_response(_response)
        true
      end
    end
  end
end