Class: Chop::UnorderedList

Inherits:
DefinitionList show all
Defined in:
lib/chop/unordered_list.rb

Instance Attribute Summary

Attributes inherited from Diff

#block, #header_transformations, #selector, #session, #table, #timeout, #transformations

Instance Method Summary collapse

Methods inherited from DefinitionList

#column, #field, #image

Methods inherited from Diff

#allow_not_found, #cell_to_image_filename, #cells, #diff!, diff!, #field, #hash_transformation, #header, #header_transformation, #image, #initialize, #rows, #text, #to_a, #transformation

Constructor Details

This class inherits a constructor from Chop::Diff

Instance Method Details

#nestedObject



9
10
11
12
13
14
15
16
# File 'lib/chop/unordered_list.rb', line 9

def nested
  self.rows_finder = ->(root) {
    recurse_tree [], root
  }
  self.text_finder = ->(cell) {
    cell.chop_prefix + cell.all(:xpath, "*[not(self::ul)]").map(&:text).join(" ").strip
  }
end