Sha256: 7b51f7ab2c73b5fd0510c895d4882c912e895cd1f10e4b0bfc8558328d4d734c

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

module Druid
  module Elements
    class UnOrderedList < Element

      def self.finders
        [:class, :id, :index, :xpath]
      end

      def [](idx)
        li = element.li(:xpath,".//li[#{idx+1}]")
        Druid::Elements::ListItem.new(li)
      end

      def items
        element.lis.size
      end

      def each
        for index in 1..self.items do
          yield self[index-1]
        end
      end
    end

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
druid-ts-1.1.1 lib/druid/elements/unordered_list.rb
druid-ts-1.1.0 lib/druid/elements/unordered_list.rb