Module: BroadbandMap::Client::SpeedTest

Included in:
BroadbandMap::Client
Defined in:
lib/broadband_map/client/speed_test.rb

Instance Method Summary collapse

Instance Method Details

#speed_test_geo_type_id(params = {}, options = {}) ⇒ Hash

Returns the speed test results for a particular geography type (e.g., state, congressional district) and geography ID.

Examples:

speed_test_geo_type_id({:geography_type => 'state', :geography_ids => ['01', '02']})

Parameters:

  • params (Hash) (defaults to: {})

    :geogrpahy_type and :geography_ids and optional :speed_test_type, :format, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



13
14
15
16
17
18
19
# File 'lib/broadband_map/client/speed_test.rb', line 13

def speed_test_geo_type_id(params={}, options={})
  params = {:format => 'json'}.merge(params)
  ids = ""
  params[:geography_ids].each {|x| ids += x +","}
  ids.chop!
  get("speedtest/#{params[:geography_type]}/ids/#{ids}?format=#{params[:format]}&speedtesttype=#{params[:speed_test_type]}&callback=#{params[:callback]}")
end

#speed_test_geo_type_name(params = {}, options = {}) ⇒ Hash

Returns the speed test results for a particular geography type (e.g., state, congressional district) and geography name (e.g., Virginia).

Examples:

speed_test_geo_type_name({:geography_type => 'state', :geography_names => ['alabama', 'arizona']})

Parameters:

  • params (Hash) (defaults to: {})

    :geogrpahy_type and :geography_names and optional :speed_test_type, :format, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



29
30
31
32
33
34
35
# File 'lib/broadband_map/client/speed_test.rb', line 29

def speed_test_geo_type_name(params={}, options={})
  params = {:format => 'json'}.merge(params)
  names = ""
  params[:geography_names].each {|x| names += x +","}
  names.chop!
  get("speedtest/#{params[:geography_type]}/names/#{names}?format=#{params[:format]}&speedtesttype=#{params[:speed_test_type]}&callback=#{params[:callback]}")
end

#speed_test_nation(params = {}, options = {}) ⇒ Hash

Returns all the speed test results for the entire United States.

Examples:

speed_test_nation()

Parameters:

  • params (Hash) (defaults to: {})

    optional :speed_test_type, :format, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



58
59
60
61
# File 'lib/broadband_map/client/speed_test.rb', line 58

def speed_test_nation(params={}, options={})
  params = {:format => 'json'}.merge(params)
  get("speedtest/nation?format=#{params[:format]}&speedtesttype=#{params[:speed_test_type]}&callback=#{params[:callback]}")
end

#speed_test_quartile(params = {}, options = {}) ⇒ Hash

Returns the minimum and maximum quartile speeds by geography type within the nation.

Examples:

speed_test_quartile({:geography_type => 'state'})

Parameters:

  • params (Hash) (defaults to: {})

    :geogrpahy_type and optional :speed_test_type, :format, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



45
46
47
48
# File 'lib/broadband_map/client/speed_test.rb', line 45

def speed_test_quartile(params={}, options={})
  params = {:format => 'json'}.merge(params)
  get("speedtest/#{params[:geography_type]}/quartile?format=#{params[:format]}&speedtesttype=#{params[:speed_test_type]}&callback=#{params[:callback]}")
end