Sha256: 8d6ca8507517ebe0127a65706bf396621d114a5132ebc8ccba68bea61d47d7a2
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
module Mohawk module Accessors class TableRow include RAutomation::Adapter::MsUia attr_reader :row def initialize(table, row_index) @table = table @row = Row.new(@table.view, :index => row_index) end def selected? row.selected? end def select row.select self end def clear row.clear self end def cells row.cells.map &:text end def all_match?(hash) hash.all? do |key, value| send(key) == "#{value}" end end def value_from_header(name) which_column = header_methods.index(name) raise ArgumentError, "#{name} column does not exist in #{header_methods}" if which_column.nil? Cell.new(row, :index => which_column).text end def method_missing(name, *args) value_from_header name end def to_hash {:text => row.text, :row => row.row } end private def header_methods @headers ||= @table.headers.map(&:to_method) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mohawk-0.1.0 | lib/mohawk/accessors/table_row.rb |