Class: VoipfoneClient::RegisteredMobile

Inherits:
Client
  • Object
show all
Defined in:
lib/voipfone_client/registered_mobile.rb

Instance Attribute Summary collapse

Attributes inherited from Client

#browser

Class Method Summary collapse

Methods inherited from Client

#account_balance, #account_details, #initialize, #parse_response, #phone_numbers, #voicemail

Constructor Details

This class inherits a constructor from VoipfoneClient::Client

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/voipfone_client/registered_mobile.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/voipfone_client/registered_mobile.rb', line 3

def number
  @number
end

Class Method Details

.allObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/voipfone_client/registered_mobile.rb', line 6

def all
  r = RegisteredMobile.new
  request = r.browser.get("#{VoipfoneClient::API_GET_URL}?registeredMobile")
  r.parse_response(request)["registeredMobile"].collect do |m|
    mobile = RegisteredMobile.new
    mobile.number = m[0]
    mobile.name = m[1]
    mobile
  end
end