Ktistec::SafeURI
Inherits Struct < Value < Object
A String wrapper marking a URL safe to emit raw into a URL
attribute slot (href, src, action, ...).
from? and from validate input and admit only absolute URLs
with an allowlisted display scheme (http, https, mailto, tel,
...).
Constants
A trusted empty URI.
Constructors
Validates and wraps the input.
Same admission rules as from? (absolute URL, allowlisted
display scheme).
Raises ArgumentError if invalid.
Use when the input is expected to always succeed and a failure indicates a bug worth surfacing.
Class methods
Validates and wraps the input.
Admits an absolute URL with an allowlisted display scheme (http, https, mailto, tel, ...). Rejects relative references.
Returns nil if invalid.
Use when the input is expected to sometimes fail and graceful continuation is preferred.