Sha256: 1debb5ef635b98eb994d5dc2ef2d226dff6989482ab6d776a0a3919c08c45a9a

Contents?: true

Size: 210 Bytes

Versions: 5

Compression:

Stored size: 210 Bytes

Contents

Array.class_eval do
  def xss_aware_join(delimiter = '')
    ''.html_safe.tap do |str|
      each_with_index do |element, i|
        str << delimiter if i > 0
        str << element
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katapult-0.5.0 lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb
katapult-0.4.1 lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb
katapult-0.4.0 lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb
katapult-0.3.0 lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb
katapult-0.2.0 lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb