Class: Bandwidth::AvailableNumber

Inherits:
Object
  • Object
show all
Extended by:
ClientWrapper
Defined in:
lib/bandwidth/available_number.rb

Overview

The Available Numbers resource lets you search for numbers that are available for use with your application.

Class Method Summary collapse

Methods included from ClientWrapper

wrap_client_arg

Class Method Details

.search_local(client, query = nil) ⇒ Array

Search for available local numbers

Examples:

result = AvailableNumber.search_local(client, {:state=>"state", :zip=>"zip", :area_code=>"code"})

Parameters:

  • client (Client)

    optional client instance to make requests

  • query (Hash) (defaults to: nil)

    hash with parametes to search: city, state, zip, areaCode, localNumber, inLocalCallingArea, quantity, pattern

Returns:

  • (Array)

    search result



25
26
27
# File 'lib/bandwidth/available_number.rb', line 25

def self.search_local(client, query = nil)
  client.make_request(:get, "#{AVAILABLE_NUMBER_PATH}/local", query)[0]
end

.search_toll_free(client, query = nil) ⇒ Array

Search for available toll free numbers

Examples:

result = AvailableNumber.search_toll_free(client, :quantity=>20)

Parameters:

  • client (Client)

    optional client instance to make requests

  • query (Hash) (defaults to: nil)

    hash with parameters to search: quantity, pattern

Returns:

  • (Array)

    search result



14
15
16
# File 'lib/bandwidth/available_number.rb', line 14

def self.search_toll_free(client, query = nil)
  client.make_request(:get, "#{AVAILABLE_NUMBER_PATH}/tollFree", query)[0]
end