Class: SB
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
-
#<<(str) ⇒ Object
Public: Append a string, making sure that it’s escaped if it’s not a “safe” string (i.e. not an instance of SB).
-
#to_s ⇒ Object
Public: Make sure converting this into a string doesn’t mark it as unsafe.
Methods inherited from String
Instance Method Details
#<<(str) ⇒ Object
Public: Append a string, making sure that it’s escaped if it’s not a “safe” string (i.e. not an instance of SB).
str - A String.
Returns self.
11 12 13 |
# File 'lib/sb.rb', line 11 def <<(str) super(SB === str ? str : SB(Hache.h(str))) end |
#to_s ⇒ Object
Public: Make sure converting this into a string doesn’t mark it as unsafe.
16 17 18 |
# File 'lib/sb.rb', line 16 def to_s self end |