Method: Marktable.foreach
- Defined in:
- lib/marktable.rb
.foreach(markdown_table, headers: true) ⇒ Object
Iterate through each row of a markdown table
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/marktable.rb', line 22 def self.foreach(markdown_table, headers: true) table = Table.new(markdown_table, headers: headers) return Enumerator.new do |yielder| table.each do |row| yielder << row.data end end unless block_given? table.each do |row| yield row.data end end |