Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/textmate_backtracer.rb

Overview

This is just a way to get around ActiveSupoprt’s html_escape method which doesn’t take into account safe stings that may be joined. If all the array’s strings are safe, we assume the separator is safe, and make the whole joined string safe.

Instance Method Summary collapse

Instance Method Details

#join_with_safety(sep = $,) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/textmate_backtracer.rb', line 7

def join_with_safety(sep=$,)
  result = join_without_safety(sep)
  if all?{|e| e.to_s.html_safe?}
    result.html_safe
  else
    result
  end
end