Class: Direct7::NUMBER_LOOKUP

Inherits:
Object
  • Object
show all
Defined in:
lib/direct7/number_lookup.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ NUMBER_LOOKUP

Returns a new instance of NUMBER_LOOKUP.



8
9
10
11
# File 'lib/direct7/number_lookup.rb', line 8

def initialize(client)
  @client = client
  @log = Logger.new(STDOUT) # You can customize the log destination as needed
end

Instance Method Details

#search_number_details(recipient) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/direct7/number_lookup.rb', line 13

def search_number_details(recipient)
  """
  Search number details.
  :param params: dict - The search request parameters.
  :return:
  """
  params = {
    'recipient' => recipient
  }
  response = @client.post(@client.host, '/hlr/v1/lookup',true, params= params)
  @log.info('Search request is success.')
  response
end