Sha256: d427f45df38d0bfe0ea229acdc12ab209f67d9e1a0a839a3d6bddaf6844f4827

Contents?: true

Size: 928 Bytes

Versions: 8

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

module Trusona
  ##
  # A scannable, pairable TruCode to assist magic logins
  class TruCode
    ##
    # Finds a TruCode using its ID
    #
    # @param id [String] The id of the TruCode we're looking for
    # @return [Trusona::Resources::TruCode] The found TruCode
    # @raise [Trusona::ResourceNotFoundError] if the TruCode cannot be found
    # @raise [Trusona::BadRequestError] if the request is improperly formatted
    # @raise [Trusona::UnauthorizedRequestError] if the request is unauthorized.
    #  Typically the result of invalid or revoked Trusona SDK keys.
    # @raise [Trusona::ApiError] if the Trusona API is experiencing problems.
    # @raise [ArgumentError] if the TruCode id is missing
    #
    def self.find(id)
      Trusona::Workers::TruCodeFinder.new.find(id)
    end

    def self.create(code)
      Trusona::Workers::TruCodeCreator.new.create(code)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trusona-2.5.3 lib/trusona/tru_code.rb
trusona-2.5.2 lib/trusona/tru_code.rb
trusona-2.5.1 lib/trusona/tru_code.rb
trusona-2.5.0 lib/trusona/tru_code.rb
trusona-2.4.0 lib/trusona/tru_code.rb
trusona-2.3.0 lib/trusona/tru_code.rb
trusona-2.2.0 lib/trusona/tru_code.rb
trusona-2.1.0 lib/trusona/tru_code.rb