Class: IndieAuthDiscovery::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/indieauth_discovery/profile.rb

Overview

User profile information discovery according to the IndieAuth spec.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Profile

Returns a new instance of Profile.



18
19
20
# File 'lib/indieauth_discovery/profile.rb', line 18

def initialize(url)
  @url = URL.new(url)
end

Instance Attribute Details

#authorization_endpointObject (readonly)

Returns the value of attribute authorization_endpoint.



16
17
18
# File 'lib/indieauth_discovery/profile.rb', line 16

def authorization_endpoint
  @authorization_endpoint
end

#micropub_endpointObject (readonly)

Returns the value of attribute micropub_endpoint.



16
17
18
# File 'lib/indieauth_discovery/profile.rb', line 16

def micropub_endpoint
  @micropub_endpoint
end

#responseObject (readonly)

Returns the value of attribute response.



16
17
18
# File 'lib/indieauth_discovery/profile.rb', line 16

def response
  @response
end

#token_endpointObject (readonly)

Returns the value of attribute token_endpoint.



16
17
18
# File 'lib/indieauth_discovery/profile.rb', line 16

def token_endpoint
  @token_endpoint
end

#urlObject (readonly)

Returns the value of attribute url.



16
17
18
# File 'lib/indieauth_discovery/profile.rb', line 16

def url
  @url
end

Class Method Details

.discover(url) ⇒ Object

Returns a new Profile after canonicalizing and verifying the URL and discovering endpoints.



23
24
25
# File 'lib/indieauth_discovery/profile.rb', line 23

def self.discover(url)
  new(url).discover
end

Instance Method Details

#discoverObject

Returns the Profile after canonicalizing and verifying the URL and discovering endpoints.



28
29
30
31
32
33
# File 'lib/indieauth_discovery/profile.rb', line 28

def discover
  canonicalize_url
  fetch_profile
  find_endpoints
  self
end