Class: FindTableRow::TableRowFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_tapas/locators/find_table_row.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page, column_expectations) ⇒ TableRowFinder

Returns a new instance of TableRowFinder.



18
19
20
21
# File 'lib/rspec_tapas/locators/find_table_row.rb', line 18

def initialize(page, column_expectations)
  @page = page
  @column_expectations = column_expectations
end

Class Method Details

.call(page, column_expectations) ⇒ Object



23
24
25
# File 'lib/rspec_tapas/locators/find_table_row.rb', line 23

def self.call(page, column_expectations)
  new(page, column_expectations).call
end

Instance Method Details

#callObject



27
28
29
30
# File 'lib/rspec_tapas/locators/find_table_row.rb', line 27

def call
  verify_table_ambiguity!
  find_row
end

#header_key_to_column_index(key) ⇒ Object



32
33
34
# File 'lib/rspec_tapas/locators/find_table_row.rb', line 32

def header_key_to_column_index(key)
  key.is_a?(String) ? existing_header_labels.index(key) : key
end