Sha256: dce13b85054af693acb798df0c1460cca8b1c58aa2f2b59ae6c7394d0dee5e0b
Contents?: true
Size: 582 Bytes
Versions: 11
Compression:
Stored size: 582 Bytes
Contents
# frozen_string_literal: true module Bridgetown class SeoTag # Mixin to share common URL-related methods between class module UrlHelper private # Determines if the given string is an absolute URL # # Returns true if an absolute URL. # Retruns false if it's a relative URL # Returns nil if it is not a string or can't be parsed as a URL def absolute_url?(string) return unless string Addressable::URI.parse(string).absolute? rescue Addressable::URI::InvalidURIError nil end end end end
Version data entries
11 entries across 11 versions & 1 rubygems