Sha256: 2d5a68d489719b0e7b54a0c0217f0cfe7a5bcd31320b7260fcaf7c02747d35e1
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
module Symbiont module WebObjects class UnorderedList < WebObject include Enumerable def initialize(web_object) @web_object = web_object end # @return [Symbiont::WebObjects::ListItem] def [](index) ::Symbiont::WebObjects::ListItem.new(children[index]) end # Return the number of list items contained in the ordered list. def items children.size end # @return [Symbiont::WebObjects::ListItem] def each for index in 1..self.items do yield self[index - 1] end end protected def list_item_xpath ".//child::li" end private def children list_items.find_all { |item| item.parent == web_object } end def list_items web_object.uls(:xpath => list_item_xpath) end end # class: UnorderedList ::Symbiont::WebObjects.class_for_tag[:ul] = ::Symbiont::WebObjects::UnorderedList end # module: WebObjects end # module: Symbiont
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
symbiont-0.2.1 | lib/symbiont/web_objects/unordered_list.rb |
symbiont-0.2.0 | lib/symbiont/web_objects/unordered_list.rb |