Class: Hanami::Utils::Escape::SafeString Private
- Inherits:
-
String
- Object
- String
- Hanami::Utils::Escape::SafeString
- Defined in:
- lib/hanami/utils/escape.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The output of an escape.
It’s marked with this special class for two reasons:
* Don't double escape the same string (this is for `Hanami::Helpers`
compatibility)
* Leave open the possibility to developers to mark a string as safe
with an higher API (eg. `#raw` in `Hanami::View` or `Hanami::Helpers`)
Instance Method Summary collapse
-
#encode(*args) ⇒ SafeString
private
Encode the string the given encoding.
-
#to_s ⇒ SafeString
private
The duped string.
Instance Method Details
#encode(*args) ⇒ SafeString
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Encode the string the given encoding
399 400 401 |
# File 'lib/hanami/utils/escape.rb', line 399 def encode(*args) self.class.new super end |
#to_s ⇒ SafeString
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the duped string.
387 388 389 |
# File 'lib/hanami/utils/escape.rb', line 387 def to_s dup end |