Method: Fech::Filing#rows_like
- Defined in:
- lib/fech/filing.rb
#rows_like(row_type, opts = {}) {|Hash| ... } ⇒ Array
Access all lines of the filing that match a given row type. Will return an Array of all available lines if called directly, or will yield the mapped rows one by one if a block is passed.
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fech/filing.rb', line 78 def rows_like(row_type, opts={}, &block) data = [] each_row(:row_type => row_type) do |row| value = parse_row?(row, opts.merge(:parse_if => row_type)) next if value == false if block_given? yield value else data << value if value end end block_given? ? nil : data end |