module Pannier::Tags::Helpers

Public Instance Methods

attrs_to_s(hash) click to toggle source
# File lib/pannier/mounted/tags.rb, line 22
def attrs_to_s(hash)
  pairs = hash.reduce([]) do |arr, pair|
    key, value = escape(pair[0].to_s), escape(pair[1].to_s)
    arr << "#{key}=\"#{value}\""
  end
  pairs.sort.join(' ')
end
escape(string) click to toggle source
# File lib/pannier/mounted/tags.rb, line 30
def escape(string)
  ERB::Util.html_escape(string)
end