Class: RAutomation::Adapter::MsUia::Menu
- Inherits:
-
Object
- Object
- RAutomation::Adapter::MsUia::Menu
- Defined in:
- lib/rautomation/adapter/ms_uia/menu.rb
Instance Attribute Summary collapse
-
#menu_items
readonly
Returns the value of attribute menu_items.
-
#window
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(window, locator) ⇒ Menu
constructor
A new instance of Menu.
- #menu(locator)
- #open
Constructor Details
#initialize(window, locator) ⇒ Menu
Returns a new instance of Menu.
8 9 10 11 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 8 def initialize(window, locator) @menu_items = [] << locator[:text] @window = window end |
Instance Attribute Details
#menu_items (readonly)
Returns the value of attribute menu_items.
5 6 7 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 5 def @menu_items end |
#window (readonly)
Returns the value of attribute window.
6 7 8 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 6 def window @window end |
Instance Method Details
#exists? ⇒ Boolean
18 19 20 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 18 def exists? UiaDll:: window.hwnd, * end |
#menu(locator)
13 14 15 16 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 13 def (locator) @menu_items << locator[:text] self end |
#open
22 23 24 25 26 27 |
# File 'lib/rautomation/adapter/ms_uia/menu.rb', line 22 def open error_info = FFI::MemoryPointer.new :char, 1024 UiaDll:: window.hwnd, error_info, 1024, * error = error_info.get_string 0 raise error unless error.empty? end |