Module: ATSPI::SelectableCollection
- Includes:
- Collection
- Defined in:
- lib/atspi/selectable_collection.rb
Overview
Included in classes representing a collection having selectable items
Defined Under Namespace
Modules: Selected
Selection collapse
-
#deselect_all ⇒ true, false
Deselects all items.
-
#select_all ⇒ true, false
Selects all items.
-
#selected ⇒ Selected
Its selected subset.
Representation collapse
-
#inspect ⇒ String
Instance as inspectable string.
Enumerable interface collapse
-
#[](idx) ⇒ Object
included
from Collection
alias for Collection#at.
-
#at(idx) ⇒ Object
included
from Collection
Item at index
idx
. -
#count ⇒ 0
included
from Collection
Default size of collection.
-
#each ⇒ Object
included
from Collection
prerequisite for Enumerable.
-
#last(n = 1) ⇒ Object+
included
from Collection
Item(s) from the end.
-
#length ⇒ Object
included
from Collection
alias for Collection#count.
-
#size ⇒ Object
included
from Collection
alias for Collection#count.
Instance Method Details
#[](idx) ⇒ Object Originally defined in module Collection
alias for #at
#at(idx) ⇒ Object Originally defined in module Collection
Returns item at index idx
.
#count ⇒ 0 Originally defined in module Collection
Returns default size of collection.
#deselect_all ⇒ true, false
Deselects all items
20 21 22 |
# File 'lib/atspi/selectable_collection.rb', line 20 def deselect_all selected.map(&:deselect).all? end |
#each ⇒ Object Originally defined in module Collection
prerequisite for Enumerable
#inspect ⇒ String
Returns instance as inspectable string.
27 28 29 |
# File 'lib/atspi/selectable_collection.rb', line 27 def inspect "#<#{self.class.name}:0x#{'%x14' % __id__} @count=#{count} @selected=#{selected.inspect}>" end |
#last(n = 1) ⇒ Object+ Originally defined in module Collection
Returns item(s) from the end.
#length ⇒ Object Originally defined in module Collection
alias for #count
#select_all ⇒ true, false
Selects all items
14 15 16 |
# File 'lib/atspi/selectable_collection.rb', line 14 def select_all map(&:select).all? end |
#selected ⇒ Selected
Returns its selected subset.
8 9 10 |
# File 'lib/atspi/selectable_collection.rb', line 8 def selected self.class::Selected.new(@native) end |
#size ⇒ Object Originally defined in module Collection
alias for #count