Sha256: c05a41cb6248beeaf6e30d6265b3558eb2ed332de17d98580a264edf0bd5548a

Contents?: true

Size: 306 Bytes

Versions: 12

Compression:

Stored size: 306 Bytes

Contents

module Arbre
  module HTML

    class Attributes < Hash

      def to_s
        self.collect do |name, value|
          "#{html_escape(name)}=\"#{html_escape(value)}\""
        end.join(" ")
      end

      protected

      def html_escape(s)
        ERB::Util.html_escape(s)
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
arbre-1.0.1 lib/arbre/html/attributes.rb
arbre-1.0.0 lib/arbre/html/attributes.rb
arbre-1.0.0.rc4 lib/arbre/html/attributes.rb
arbre-1.0.0.rc3 lib/arbre/html/attributes.rb
arbre-1.0.0.rc2 lib/arbre/html/attributes.rb
arbre-1.0.0.rc1 lib/arbre/html/attributes.rb
activeadmin-0.4.4 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.4.3 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.4.2 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.4.1 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.4.0 lib/active_admin/arbre/html/attributes.rb
andrewroth_activeadmin-0.3.4.4 lib/active_admin/arbre/html/attributes.rb