struct

Hecr::Safe

Inherits Struct < Value < Object

Wraps strings that are already HTML-safe so they are not double-escaped. Components return Hecr::Safe; interpolating a Safe value emits it verbatim, interpolating anything else escapes it.

Constructors

new(to_safe_html : String)
Source

Instance methods

==(other : Safe) : Bool
Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
to_safe_html
Source