Class: SevenApi::Resources::Lookup

Inherits:
SevenApi::Resource show all
Defined in:
lib/seven_api/resources/lookup.rb

Constant Summary collapse

PATHS =
{
  :cnam => '/cnam',
  :format => '/format',
  :hlr => '/hlr',
  :mnp => '/mnp',
  :rcs_capabilities => '/rcs'
}

Constants inherited from SevenApi::Resource

SevenApi::Resource::BASE_PATH

Instance Attribute Summary

Attributes inherited from SevenApi::Resource

#api_key, #builder, #conn, #endpoint, #http_methods, #request_methods, #sent_with

Instance Method Summary collapse

Methods inherited from SevenApi::Resource

get_endpoint, get_http_methods, #initialize

Constructor Details

This class inherits a constructor from SevenApi::Resource

Instance Method Details

#cnam(number) ⇒ Hash, Array

Perform a caller name lookup read more: docs.seven.io/en/rest-api/endpoints/lookup#cnam

Parameters:

  • number (String)

Returns:

  • (Hash, Array)


28
29
30
# File 'lib/seven_api/resources/lookup.rb', line 28

def cnam(number)
  request({}, {number: number}, PATHS[:cnam])
end

#format(number) ⇒ String, Hash

Retrieve phone number formats read more: docs.seven.io/en/rest-api/endpoints/lookup#format

Parameters:

  • number (String)

Returns:

  • (String, Hash)


36
37
38
# File 'lib/seven_api/resources/lookup.rb', line 36

def format(number)
  request({}, {number: number}, PATHS[:format])
end

#hlr(number) ⇒ Hash, Array

Perform a home location register lookup read more: docs.seven.io/en/rest-api/endpoints/lookup#hlr

Parameters:

  • number (String)

Returns:

  • (Hash, Array)


44
45
46
# File 'lib/seven_api/resources/lookup.rb', line 44

def hlr(number)
  request({}, {number: number}, PATHS[:hlr])
end

#mnp(number) ⇒ Hash, Array

Perform a mobile number portability lookup read more: docs.seven.io/en/rest-api/endpoints/lookup#mnp

Parameters:

  • number (String)

Returns:

  • (Hash, Array)


52
53
54
# File 'lib/seven_api/resources/lookup.rb', line 52

def mnp(number)
  request({}, {number: number}, PATHS[:mnp])
end

#rcs_capabilities(number) ⇒ Hash, Array

Perform a RCS capabilities lookup read more: docs.seven.io/en/rest-api/endpoints/lookup#rcs-capabilities

Parameters:

  • number (String)

Returns:

  • (Hash, Array)


60
61
62
# File 'lib/seven_api/resources/lookup.rb', line 60

def rcs_capabilities(number)
  request({}, {number: number}, PATHS[:rcs])
end