module WebFinger

NOTE:

Make a JSON Resource Descriptor (JRD) gem as separate one and use it as superclass?

Constants

VERSION

Public Instance Methods

debug!() click to toggle source
# File lib/webfinger.rb, line 33
def debug!
  self.debugging = true
end
debugging=(boolean) click to toggle source
# File lib/webfinger.rb, line 30
def debugging=(boolean)
  @debugging = boolean
end
debugging?() click to toggle source
# File lib/webfinger.rb, line 27
def debugging?
  @debugging
end
discover!(resource, options = {}) click to toggle source
# File lib/webfinger.rb, line 14
def discover!(resource, options = {})
  Request.new(resource, options).discover!
end
http_client() click to toggle source
# File lib/webfinger.rb, line 45
def http_client
  Faraday.new(headers: {user_agent: "WebFinger #{VERSION}"}) do |faraday|
    faraday.response :raise_error
    faraday.response :json
    faraday.response :follow_redirects
    faraday.response :logger, WebFinger.logger if debugging?
    faraday.adapter Faraday.default_adapter
    http_config.try(:call, faraday)
  end
end
http_config(&block) click to toggle source
# File lib/webfinger.rb, line 56
def http_config(&block)
  @http_config ||= block
end
logger() click to toggle source
# File lib/webfinger.rb, line 18
def logger
  @logger
end
logger=(logger) click to toggle source
# File lib/webfinger.rb, line 21
def logger=(logger)
  @logger = logger
end
url_builder() click to toggle source
# File lib/webfinger.rb, line 38
def url_builder
  @url_builder ||= URI::HTTPS
end
url_builder=(builder) click to toggle source
# File lib/webfinger.rb, line 41
def url_builder=(builder)
  @url_builder = builder
end