Sha256: 1ebf87f5e7166584f57a2e322097e8fc038ba942f80b157fee244ea7b6718d37

Contents?: true

Size: 759 Bytes

Versions: 15

Compression:

Stored size: 759 Bytes

Contents

require 'HTTParty'

class MDBClient

  def initialize
    @base_uri = ENV["MDB"] || "http://localhost:9099"
  end

  def format_android_devices(devices)
    query = { deviceLog: devices }.to_json
    puts query
    response = HTTParty.post("#{@base_uri}/processDevices", body: query, headers: default_headers)
    device_names  = JSON.parse(response.to_s)
    return  device_names
  end

  def format_ios_devices(devices)
    body = { deviceLog: devices }.to_json
    response = HTTParty.post("#{@base_uri}/processIosDevices", body: body, headers: default_headers)
    device_names  = JSON.parse(response.to_s)
    return device_names
  end

  def default_headers
    headers = {
        'Content-Type': "Application/json"
    }
    return headers
  end


end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
optimus-runner-1.2.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.1.4 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.1.3 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.1.2 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.1.1 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.1.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-1.0.2 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.15.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.14.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.13.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.12.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.11.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.10.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.9.0 lib/optimus-runner/clients/mdb_client.rb
optimus-runner-0.8.0 lib/optimus-runner/clients/mdb_client.rb