struct

Ktistec::SafeAttrValue

Inherits Struct < Value < Object

A String wrapper marking a value safe to emit raw inside a double-quoted HTML attribute (attr="..."), other than URL or event-handler slots. Not interchangeable with SafeHTML: HTML markup like <em>x</em> is SafeHTML but is not safe inside an attribute value.

Constructors

assert_safe(string : String) : SafeAttrValue

Asserts the input is already safe inside an HTML attribute.

Source
escape(string : String | Nil) : SafeAttrValue

Attribute-encodes the input.

Source
escape(value : Int) : SafeAttrValue

Attribute-encodes the input.

Source

Instance methods

==(other : SafeAttrValue) : Bool
Source
==(other : String) : Bool
Source
=~(other : Regex)
Source
empty?(*args, **options)
Source
empty?(*args, **options, &)
Source
includes?(*args, **options)
Source
includes?(*args, **options, &)
Source
presence

Returns self if the wrapped value has presence, otherwise nil.

Source
size(*args, **options)
Source
size(*args, **options, &)
Source
to_json(*args, **options)
Source
to_json(*args, **options, &)
Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source