Class: ATSPI::Accessible::Table::Rows::Selected

Inherits:
Object
  • Object
show all
Includes:
SelectableCollection::Selected
Defined in:
lib/atspi/accessible/table/rows/selected.rb

Overview

Represents all selected rows of a ATSPI::Accessible::Table.

Instance are enumerables supporting item access and can be treated more or less like an array.

Enumerable interface collapse

Representation collapse

Instance Method Details

#[](idx) ⇒ Object Originally defined in module Collection

alias for #at

#at(n) ⇒ Row

Returns the table’s n’th selected row.

Parameters:

  • n (Integer)

    the index in the collection of selected rows and not the index in the collection of all the table’s rows.

Returns:

  • (Row)

    the table’s n’th selected row



31
32
33
34
35
# File 'lib/atspi/accessible/table/rows/selected.rb', line 31

def at(n)
  super do |idx|
    Row.new(@native, idx)
  end
end

#countInteger

Returns the number of selected rows.

Returns:

  • (Integer)

    the number of selected rows

See Also:



39
40
41
# File 'lib/atspi/accessible/table/rows/selected.rb', line 39

def count
  @native.n_selected_rows
end

#eachObject

Iterates over all selected rows



21
22
23
24
25
# File 'lib/atspi/accessible/table/rows/selected.rb', line 21

def each
  @native.selected_rows.each do |idx|
    yield at(idx)
  end
end

#inspectString Originally defined in module SelectableCollection::Selected

Returns instance as inspectable string.

Returns:

  • (String)

    instance as inspectable string

#last(n = 1) ⇒ Object+ Originally defined in module Collection

Returns item(s) from the end.

Parameters:

  • n (Integer) (defaults to: 1)

    number of items to return

Returns:

  • (Object, Array<Object>)

    item(s) from the end

#lengthObject Originally defined in module Collection

alias for #count

#sizeObject Originally defined in module Collection

alias for #count