Class: ActiveSupport::SafeBuffer
- Inherits:
-
String
show all
- Defined in:
- lib/active_support/core_ext/string/output_safety.rb
Constant Summary
Constants inherited
from String
String::INTERPOLATION_PATTERN, String::INTERPOLATION_PATTERN_WITH_ESCAPE
Instance Method Summary
collapse
Methods inherited from String
#%, #as_json, #as_str, #blank?, #interpolate_without_ruby_19_syntax, #to_json, #to_xs
#chars, #is_utf8?, #mb_chars
#acts_like_string?
append_features, #each_char
append_features, #ends_with?, #starts_with?
#camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, #parameterize, #pluralize, #singularize, #tableize, #titleize, #underscore
#squish, #squish!
#ord, #to_date, #to_datetime, #to_time
#at, #first, #from, #last, #to
Instance Method Details
76
77
78
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 76
def +(other)
dup.concat(other)
end
|
#concat(value) ⇒ Object
Also known as:
<<
67
68
69
70
71
72
73
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 67
def concat(value)
if value.html_safe?
super(value)
else
super(ERB::Util.h(value))
end
end
|
#html_safe ⇒ Object
84
85
86
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 84
def html_safe
self
end
|
#html_safe? ⇒ Boolean
80
81
82
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 80
def html_safe?
true
end
|
#safe_concat ⇒ Object
65
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 65
alias safe_concat concat
|
88
89
90
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 88
def to_s
self
end
|
#to_yaml(*args) ⇒ Object
92
93
94
|
# File 'lib/active_support/core_ext/string/output_safety.rb', line 92
def to_yaml(*args)
to_str.to_yaml(*args)
end
|