Class: Posthubify::NumbersResource
- Inherits:
-
Object
- Object
- Posthubify::NumbersResource
- Defined in:
- lib/posthubify/resources/telecom.rb
Overview
Phone number provisioning (Node sdk .numbers).
Instance Method Summary collapse
-
#buy(input) ⇒ Object
Buy a new number ({ ‘country’ => …, ‘profileId’ => … }).
-
#countries ⇒ Object
List countries where a number can be purchased.
-
#initialize(http) ⇒ NumbersResource
constructor
A new instance of NumbersResource.
-
#list ⇒ Object
List the numbers on the account.
-
#release(id) ⇒ Object
Release the number (cancel it).
Constructor Details
#initialize(http) ⇒ NumbersResource
Returns a new instance of NumbersResource.
6 7 8 |
# File 'lib/posthubify/resources/telecom.rb', line 6 def initialize(http) @http = http end |
Instance Method Details
#buy(input) ⇒ Object
Buy a new number ({ ‘country’ => …, ‘profileId’ => … }).
21 22 23 |
# File 'lib/posthubify/resources/telecom.rb', line 21 def buy(input) @http.data('POST', '/numbers', body: input) end |
#countries ⇒ Object
List countries where a number can be purchased.
11 12 13 |
# File 'lib/posthubify/resources/telecom.rb', line 11 def countries @http.data('GET', '/numbers/countries') end |
#list ⇒ Object
List the numbers on the account.
16 17 18 |
# File 'lib/posthubify/resources/telecom.rb', line 16 def list @http.data('GET', '/numbers') end |
#release(id) ⇒ Object
Release the number (cancel it).
26 27 28 |
# File 'lib/posthubify/resources/telecom.rb', line 26 def release(id) @http.data('DELETE', "/numbers/#{id}") end |