Class: Bridgetown::Webfinger::Href

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

Overview

Wraps an ‘href` member within a Link, which is the target URI

Class Method Summary collapse

Methods included from Logging

included, #warn

Class Method Details

.parse(href) ⇒ Href?

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::Href when the value is one

Hrefs [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.4.3

Returns:

Since:

  • 0.1.0



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

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