class SauceWhisk::Accounts

def self.concurrency_for(job_id = ENV["SAUCE_USERNAME"], type = :both)

def self.concurrency_for(job_id = ENV["SAUCE_USERNAME"], type = :both)
  concurrencies = JSON.parse (get "#{job_id}/limits"), :symbolize_names => true
  case type
    when :mac
      return concurrencies[:mac_concurrency]
    when :total
      return concurrencies[:concurrency]
    else
      return {:mac_concurrency => concurrencies[:mac_concurrency],
              :total_concurrency => concurrencies[:concurrency]
      }
  end
end