Class: Mohawk::Accessors::TableRow
- Inherits:
-
Object
- Object
- Mohawk::Accessors::TableRow
show all
- Includes:
- RAutomation::Adapter::MsUia
- Defined in:
- lib/mohawk/accessors/table_row.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(table, row_index) ⇒ TableRow
Returns a new instance of TableRow.
8
9
10
11
|
# File 'lib/mohawk/accessors/table_row.rb', line 8
def initialize(table, row_index)
@table = table
@row = Row.new(@table.view, :index => row_index)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
37
38
39
|
# File 'lib/mohawk/accessors/table_row.rb', line 37
def method_missing(name, *args)
name
end
|
Instance Attribute Details
#row ⇒ Object
Returns the value of attribute row.
6
7
8
|
# File 'lib/mohawk/accessors/table_row.rb', line 6
def row
@row
end
|
Instance Method Details
#all_match?(hash) ⇒ Boolean
25
26
27
28
29
|
# File 'lib/mohawk/accessors/table_row.rb', line 25
def all_match?(hash)
hash.all? do |key, value|
send(key) == "#{value}"
end
end
|
#cells ⇒ Object
21
22
23
|
# File 'lib/mohawk/accessors/table_row.rb', line 21
def cells
row.cells.map &:text
end
|
#select ⇒ Object
17
18
19
|
# File 'lib/mohawk/accessors/table_row.rb', line 17
def select
@table.view.select row.row
end
|
#selected? ⇒ Boolean
13
14
15
|
# File 'lib/mohawk/accessors/table_row.rb', line 13
def selected?
@table.view.selected? row.row
end
|
#to_hash ⇒ Object
41
42
43
|
# File 'lib/mohawk/accessors/table_row.rb', line 41
def to_hash
{:text => row.text, :row => row.row }
end
|
31
32
33
34
35
|
# File 'lib/mohawk/accessors/table_row.rb', line 31
def (name)
which_column = .index(name)
raise ArgumentError, "#{name} column does not exist in #{}" if which_column.nil?
Cell.new(row, :index => which_column).text
end
|