Sha256: 909d4a979e5b49355b7a57cfb189de7057d2ca1a88c9f6aeb2ba88f789a723df

Contents?: true

Size: 411 Bytes

Versions: 6

Compression:

Stored size: 411 Bytes

Contents

module Arbre
  module HTML

    # Stores a collection of Element objects
    class Collection < Array

      def +(other)
        self.class.new(super)
      end

      def -(other)
        self.class.new(super)
      end

      def &(other)
        self.class.new(super)
      end

      def to_s
        self.collect do |element|
          element.to_s
        end.join.html_safe
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
activeadmin-0.4.4 lib/active_admin/arbre/html/collection.rb
activeadmin-0.4.3 lib/active_admin/arbre/html/collection.rb
activeadmin-0.4.2 lib/active_admin/arbre/html/collection.rb
activeadmin-0.4.1 lib/active_admin/arbre/html/collection.rb
activeadmin-0.4.0 lib/active_admin/arbre/html/collection.rb
andrewroth_activeadmin-0.3.4.4 lib/active_admin/arbre/html/collection.rb