Class: Luoma::HTMLSafe
- Defined in:
- lib/luoma/drops/html_safe.rb,
sig/luoma/drops/html_safe.rbs
Class Method Summary collapse
-
.escape(value) ⇒ HTMLSafe
(String | HTMLSafe) -> HTMLSafe.
-
.from(value) ⇒ HTMLSafe
(String | HTMLSafe) -> HTMLSafe.
Instance Method Summary collapse
-
#initialize(s) ⇒ HTMLSafe
constructor
(String) -> void.
- #render(context) ⇒ Object
- #to_primitive(hint, context) ⇒ Object
Methods inherited from Drop
#contains?, #each, #eq?, #fetch, #gt?, #key?, #length, #lt?, #slice, #to_a, #to_s
Constructor Details
#initialize(s) ⇒ HTMLSafe
(String) -> void
16 17 18 19 |
# File 'lib/luoma/drops/html_safe.rb', line 16 def initialize(s) super() @s = s end |
Class Method Details
Instance Method Details
#render(context) ⇒ Object
32 33 34 |
# File 'lib/luoma/drops/html_safe.rb', line 32 def render(context) @s end |
#to_primitive(hint, context) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/luoma/drops/html_safe.rb', line 22 def to_primitive(hint, context) case hint when :string, :data @s else :nothing end end |