Class: ActiveSupport::SafeBuffer

Inherits:
String
  • Object
show all
Defined in:
lib/ckeditor/safe_buffer.rb

Instance Method Summary collapse

Instance Method Details

#+(other) ⇒ Object



14
15
16
# File 'lib/ckeditor/safe_buffer.rb', line 14

def +(other)
  dup.concat(other)
end

#concat(value) ⇒ Object Also known as: <<



5
6
7
8
9
10
11
# File 'lib/ckeditor/safe_buffer.rb', line 5

def concat(value)
  if value.html_safe?
    super(value)
  else
    super(ERB::Util.h(value))
  end
end

#html_safeObject



22
23
24
# File 'lib/ckeditor/safe_buffer.rb', line 22

def html_safe
  self
end

#html_safe?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ckeditor/safe_buffer.rb', line 18

def html_safe?
  true
end

#safe_concatObject



3
# File 'lib/ckeditor/safe_buffer.rb', line 3

alias safe_concat concat

#to_sObject



26
27
28
# File 'lib/ckeditor/safe_buffer.rb', line 26

def to_s
  self
end

#to_yaml(*args) ⇒ Object



30
31
32
# File 'lib/ckeditor/safe_buffer.rb', line 30

def to_yaml(*args)
  to_str.to_yaml(*args)
end