Class: ActionView::SafeBuffer

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

Instance Method Summary collapse

Instance Method Details

#<<(value) ⇒ Object



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

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

#concat(value) ⇒ Object



12
13
14
# File 'lib/action_view/safe_buffer.rb', line 12

def concat(value)
  self << value
end

#html_safe!Object



20
21
22
# File 'lib/action_view/safe_buffer.rb', line 20

def html_safe!
  self
end

#html_safe?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/action_view/safe_buffer.rb', line 16

def html_safe?
  true
end

#to_sObject



24
25
26
# File 'lib/action_view/safe_buffer.rb', line 24

def to_s
  self
end