Sha256: 87b505194edf1201170672975a463da468ef59da9a3eaf8bd9a34d354eedcbf2

Contents?: true

Size: 668 Bytes

Versions: 12

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

module Trusona
  module Workers
    #
    ## Finds user identifers
    class UserIdentifierFinder
      def initialize(service: nil)
        @service = service || Trusona::Services::UserIdentifiersService.new
      end

      def find(opts)
        raise ArgumentError, 'Missing user identifier' unless
          contains_required_arguments(opts)
        @service.get(build_resource(opts))
      end

      private

      def contains_required_arguments(opts)
        opts[:identifier] || opts['identifier']
      end

      def build_resource(options)
        Trusona::Resources::UserIdentifier.new(options)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
trusona-2.4.0 lib/trusona/workers/user_identifier_finder.rb
trusona-2.3.0 lib/trusona/workers/user_identifier_finder.rb
trusona-2.2.0 lib/trusona/workers/user_identifier_finder.rb
trusona-2.1.0 lib/trusona/workers/user_identifier_finder.rb
trusona-2.0.0 lib/trusona/workers/user_identifier_finder.rb
trusona-1.0.1 lib/trusona/workers/user_identifier_finder.rb
trusona-1.0.0 lib/trusona/workers/user_identifier_finder.rb
trusona-0.20.0 lib/trusona/workers/user_identifier_finder.rb
trusona-0.19.0 lib/trusona/workers/user_identifier_finder.rb
trusona-0.18.2 lib/trusona/workers/user_identifier_finder.rb
trusona-0.18.1 lib/trusona/workers/user_identifier_finder.rb
trusona-0.16.0 lib/trusona/workers/user_identifier_finder.rb