Sha256: 6f75f735e3dbf821ea5fa5fdcc42301da9e6222093e297bff39d6d85c2e16de3

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

module Druid
  module Elements
    class OrderedList < Element
      attr_accessor :li_element

      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 OrderedList
      #
      def list_items
        @list_items ||= children(tag_name: 'li')
      end

    end

    Druid::Elements.tag_to_class[:ol] = Druid::Elements::OrderedList
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

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