Class: ATSPI::Accessible::Table::Columns::Selected

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

Overview

Represents all selected columns 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) ⇒ Column

Returns the table’s n’th selected column.

Parameters:

  • n (Integer)

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

Returns:

  • (Column)

    the table’s n’th selected column



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

def at(n)
  super do |mapped_idx|
    Column.new(@native, mapped_idx)
  end
end

#countInteger

Returns the number of selected columns.

Returns:

  • (Integer)

    the number of selected columns

See Also:



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

def count
  @native.n_selected_columns
end

#eachObject

Iterates over all selected columns



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

def each
  @native.selected_columns.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