Class: Bridgetown::Webfinger::Alias

Inherits:
Model
  • Object
show all
Defined in:
lib/bridgetown/webfinger/alias.rb

Overview

Wraps an ‘alias` member within a JRD, which is a URI identifying the same subject

Class Method Summary collapse

Methods included from Logging

included, #warn

Class Method Details

.parse(moniker) ⇒ Alias?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parses and maybe-returns an Bridgetown::Webfinger::Alias when the value is one

Aliases [must be URIs] so when the value is not a proper URI, it is ignored.

[1]: datatracker.ietf.org/doc/html/rfc7033#section-4.4.2

Returns:

Since:

  • 0.1.0



18
19
20
21
22
23
24
25
26
# File 'lib/bridgetown/webfinger/alias.rb', line 18

def self.parse(moniker)
  if Webfinger.uri?(moniker)
    new(moniker)
  else
    warn(
      "Webfinger alias is malformed: #{moniker.inspect}, ignoring"
    )
  end
end