Module: LapisLazuli::WorldModule::Browser
Overview
Module managing a browser instance
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#browser(*args) ⇒ Object
Get the current main browser.
-
#has_browser? ⇒ Boolean
Checks if there is a browser started.
Methods included from ClassMethods
browser_module, browser_modules
Methods included from Proxy
Methods included from Logging
Methods included from Config
#config, #current_env, #env, #env_or_config, #has_config?, #has_env?, #has_env_or_config?, #init, #load_config, #load_config_from_file, #var_from_env
Methods included from Config::ClassMethods
Methods included from Error
Instance Method Details
#browser(*args) ⇒ Object
Get the current main browser
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/lapis_lazuli/world/browser.rb', line 50 def browser(*args) b = Runtime.instance.set_if(self, :browser) do # Add LL to the arguments for the browser LapisLazuli::Browser.set_world(self) # Create & return a new browser object LapisLazuli::Browser.new(*args) end if not b.is_open? b.start end return b end |
#has_browser? ⇒ Boolean
Checks if there is a browser started
43 44 45 46 |
# File 'lib/lapis_lazuli/world/browser.rb', line 43 def has_browser? b = Runtime.instance.get :browser return (not b.nil? and b.is_open?) end |