Module: Gametel::Navigation
- Includes:
- Waiter, PageNavigation
- Defined in:
- lib/gametel/navigation.rb
Overview
Module to facilitate create new gametel screen objects in definitions.
Instance Method Summary collapse
-
#on(cls, &block) ⇒ Object
create a new screen given a class name.
Methods included from Waiter
Instance Method Details
#on(cls, &block) ⇒ Object
create a new screen given a class name
15 16 17 18 19 20 21 |
# File 'lib/gametel/navigation.rb', line 15 def on(cls, &block) @current_screen = @current_page = cls.new waiting_for = "#{cls} to be active" wait_until(10, waiting_for) { @current_screen.active? } if @current_screen.respond_to?(:active?) block.call @current_screen if block @current_screen end |