Sha256: b7a04fc10ac3315ddb7c34019f9d38e15b9b258d78a90825ee4a5be744f237f5

Contents?: true

Size: 564 Bytes

Versions: 3

Compression:

Stored size: 564 Bytes

Contents

module Druid
  module Elements
    class UnOrderedList < Element

      #
      # @return [Druid::Elements::ListItem]
      #
      def [](idx)
        list_items[idx]
      end

      def items
        list_items.size
      end

      def each(&block)
        list_items.each(&block)
      end

      #
      # Return Array of ListItem objects that are children of the UnorderedList
      #
      def list_items
        @list_items ||= children(tag_name: 'li')
      end

    end

    Druid::Elements.tag_to_class[:ul] = Druid::Elements::UnOrderedList

  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
druid-s-1.0.0 lib/druid/elements/unordered_list.rb
druid-ts-1.2.6 lib/druid/elements/unordered_list.rb
druid-ts-1.2.5 lib/druid/elements/unordered_list.rb