Class: SerwerSMS::Resources::Phones

Inherits:
Object
  • Object
show all
Defined in:
lib/serwersms/resources/phones.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Phones

Returns a new instance of Phones.



4
5
6
# File 'lib/serwersms/resources/phones.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#check(phone, id = nil) ⇒ Hash

Check phone via HLR

Parameters:

  • phone (String)
  • id (String) (defaults to: nil)

    Query ID returned if processing takes longer than 60 seconds

Returns:

  • (Hash)

    @option return [String] :phone @option return [String] :status @option return [Integer] :imsi @option return [String] :network @option return [Boolean] :ported @option return [String] :network_ported



19
20
21
# File 'lib/serwersms/resources/phones.rb', line 19

def check(phone, id = nil)
  @client.call('phones/check', 'phone' => phone, 'id' => id)
end

#test(phone) ⇒ Hash

Validate phone number

Parameters:

  • phone (String)

Returns:

  • (Hash)

    @option return [Boolean] :correct



28
29
30
# File 'lib/serwersms/resources/phones.rb', line 28

def test(phone)
  @client.call('phones/test', 'phone' => phone)
end