Class: YuiRestClient::Widgets::Selectionbox
- Defined in:
- lib/yui_rest_client/widgets/selectionbox.rb
Overview
Class representing a selectionbox in the UI. It can be YSelectionBox.
Instance Method Summary collapse
-
#items ⇒ Array
Returns the list of items available to select from selection box.
-
#select(item) ⇒ Selectionbox
Sends action to click the selection in UI.
-
#selected_item ⇒ Object
Returns selected item in selection box.
Methods inherited from Base
#action, #collect_all, #debug_label, #enabled?, #exists?, #initialize, #property
Methods included from YuiRestClient::Waitable
Constructor Details
This class inherits a constructor from YuiRestClient::Widgets::Base
Instance Method Details
#items ⇒ Array
Returns the list of items available to select from selection box.
39 40 41 |
# File 'lib/yui_rest_client/widgets/selectionbox.rb', line 39 def items property(:items).map { |x| x[:label] } end |
#select(item) ⇒ Selectionbox
Sends action to click the selection in UI.
48 49 50 51 |
# File 'lib/yui_rest_client/widgets/selectionbox.rb', line 48 def select(item) action(action: Actions::SELECT, value: item) self end |
#selected_item ⇒ Object
Returns selected item in selection box.
82 83 84 |
# File 'lib/yui_rest_client/widgets/selectionbox.rb', line 82 def selected_item property(:items).select { |x| x[:selected] }.first[:label] end |