Class: HaveTable::RowSequence
- Inherits:
-
Object
- Object
- HaveTable::RowSequence
- Includes:
- Enumerable
- Defined in:
- lib/have_table/row_sequence.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(table_node) ⇒ RowSequence
constructor
A new instance of RowSequence.
Constructor Details
#initialize(table_node) ⇒ RowSequence
Returns a new instance of RowSequence.
5 6 7 8 9 10 |
# File 'lib/have_table/row_sequence.rb', line 5 def initialize(table_node) raise "did not receive a <table> node" unless table_node.name == "table" @tr_nodes = table_node.xpath("tr") read_header end |
Instance Method Details
#each ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/have_table/row_sequence.rb', line 12 def each reset while true if is_on_header? next_row next end row = next_row break unless row yield(row) end end |