Class: YuiRestClient::Widgets::Tab
- Defined in:
- lib/yui_rest_client/widgets/tab.rb
Overview
Class representing a tab in the UI. It can be YDumbTab.
Instance Method Summary collapse
-
#items ⇒ Array
Returns the list of items available to select from tab.
-
#select(item) ⇒ Tab
Sends action to click the tab in UI.
-
#selected_item ⇒ String
Returns the label of the selected tab.
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 tab.
36 37 38 |
# File 'lib/yui_rest_client/widgets/tab.rb', line 36 def items property(:items).map { |x| x[:label] } end |
#select(item) ⇒ Tab
Sends action to click the tab in UI.
45 46 47 48 |
# File 'lib/yui_rest_client/widgets/tab.rb', line 45 def select(item) action(action: Actions::SELECT, value: item) self end |
#selected_item ⇒ String
Returns the label of the selected tab.
76 77 78 |
# File 'lib/yui_rest_client/widgets/tab.rb', line 76 def selected_item property(:items).select { |x| x[:selected] }.first[:label] end |