goldfinger.rb 778 B

123456789101112131415161718192021222324252627
  1. # frozen_string_literal: true
  2. require 'goldfinger/request'
  3. require 'goldfinger/link'
  4. require 'goldfinger/result'
  5. require 'goldfinger/utils'
  6. require 'goldfinger/client'
  7. module Goldfinger
  8. class Error < StandardError
  9. end
  10. class NotFoundError < Error
  11. end
  12. # Returns result for the Webfinger query
  13. #
  14. # @raise [Goldfinger::NotFoundError] Error raised when the Webfinger resource could not be retrieved
  15. # @raise [Goldfinger::SSLError] Error raised when there was a SSL error when fetching the resource
  16. # @param uri [String] A full resource identifier in the format acct:user@example.com
  17. # @param opts [Hash] Options passed to HTTP.rb client
  18. # @return [Goldfinger::Result]
  19. def self.finger(uri, opts = {})
  20. Goldfinger::Client.new(uri, opts).finger
  21. end
  22. end