Class: Simulacrum::Browserstack::API

Inherits:
Object
  • Object
show all
Defined in:
lib/simulacrum/browserstack/api.rb

Overview

The Browserstack API class wraps up functionality for talking to the Browserstack REST API.

Instance Method Summary collapse

Constructor Details

#initialize(username, apikey) ⇒ API

Returns a new instance of API.



10
11
12
13
# File 'lib/simulacrum/browserstack/api.rb', line 10

def initialize(username, apikey)
  @username = username
  @apikey = apikey
end

Instance Method Details

#account_detailsObject



15
16
17
18
19
20
21
# File 'lib/simulacrum/browserstack/api.rb', line 15

def 
  request = request('https://www.browserstack.com/automate/plan.json')
   = OpenStruct.new
  .sessions_running = request['parallel_sessions_running'].to_i
  .sessions_allowed = request['parallel_sessions_max_allowed'].to_i
  
end