Sha256: 5ee1568359c1a5a2a4b6a016e74f77d301cefe76fb372bf1cecc1cb2b293de6b
Contents?: true
Size: 505 Bytes
Versions: 4
Compression:
Stored size: 505 Bytes
Contents
require "chop/diff" module Chop class DefinitionList < Diff self.default_selector = "dl" self.rows_finder = ->(root) do root.all("dt,dd").slice_before do |node| node.tag_name == "dt" end end self.cells_finder = ->(row) { row } def column index, &block transformation do |rows| rows.map.with_index do |row, row_index| row[index] = block.call(row[index]) row end end end end Dl = DefinitionList end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
chop-0.20.1 | lib/chop/definition_list.rb |
chop-0.20.0 | lib/chop/definition_list.rb |
chop-0.19.0 | lib/chop/definition_list.rb |
chop-0.18.0 | lib/chop/definition_list.rb |