Class: Simulacrum::Browserstack::Tunnel
- Inherits:
-
Object
- Object
- Simulacrum::Browserstack::Tunnel
- Defined in:
- lib/simulacrum/browserstack/tunnel.rb
Overview
Class for handling Browserstack tunnel opening/closing/management
Constant Summary collapse
- DEFAULT_OPTIONS =
{ skip_check: true, only_automate: false, verbose: false, force: true }
Instance Attribute Summary collapse
-
#open ⇒ Object
(also: #open?)
readonly
Returns the value of attribute open.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
-
#selenium_remote_url ⇒ Object
readonly
Returns the value of attribute selenium_remote_url.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(username, apikey, ports, options = {}) ⇒ Tunnel
constructor
A new instance of Tunnel.
Constructor Details
#initialize(username, apikey, ports, options = {}) ⇒ Tunnel
Returns a new instance of Tunnel.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 20 def initialize(username, apikey, ports, = {}) @pid = nil @open = false @username = username @apikey = apikey @ports = ports = OpenStruct.new(DEFAULT_OPTIONS.clone.merge!()) create_tunnel ensure_open end |
Instance Attribute Details
#open ⇒ Object (readonly) Also known as: open?
Returns the value of attribute open.
10 11 12 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 10 def open @open end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
10 11 12 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 10 def pid @pid end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
10 11 12 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 10 def ports @ports end |
#selenium_remote_url ⇒ Object (readonly)
Returns the value of attribute selenium_remote_url.
10 11 12 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 10 def selenium_remote_url @selenium_remote_url end |
Instance Method Details
#close ⇒ Object
36 37 38 |
# File 'lib/simulacrum/browserstack/tunnel.rb', line 36 def close kill end |