class Hanami::View::HTML::SafeString
A string that has been marked as “HTML safe”, ensuring that it is not automatically escaped when used in HTML
view templates.
A SafeString
is frozen when initialized to ensure it cannot be mutated after being marked as safe, which could be an avenue for injection of unsafe content.
@see String#html_safe
@api public @since 2.1.0
Public Class Methods
Source
# File lib/hanami/view/html.rb, line 23 def initialize(string) super(string) freeze end
@api public @since 2.1.0
Calls superclass method
Public Instance Methods
Source
# File lib/hanami/view/html.rb, line 47 def html_safe self end
@return [self]
@api public @since 2.1.0
Source
# File lib/hanami/view/html.rb, line 39 def html_safe? true end
@return [true]
@api public @since 2.1.0
Source
# File lib/hanami/view/html.rb, line 55 def to_s self end
@return [self]
@api public @since 2.1.0
Private Instance Methods
Source
# File lib/hanami/view/html.rb, line 30 def initialize_copy(other) super freeze end
@api private @since 2.1.0
Calls superclass method