Class: BandwidthIris::AvailableNumber

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

Class Method Summary collapse

Methods included from ClientWrapper

wrap_client_arg

Class Method Details

.list(client, query) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/bandwidth-iris/available_number.rb', line 7

def self.list(client, query)
  response = client.make_request(:get, client.(AVAILABLE_NUMBER_PATH), query)
  list = response[0] && response[0][:telephone_number_list] && response[0][:telephone_number_list][:telephone_number]
  list ||= response[0] && response[0][:telephone_number_detail_list] && response[0][:telephone_number_detail_list][:telephone_number_detail]
  return [] if !list
  if list.is_a?(Array) then list else [list] end
end