Method: Elk::Number.allocate
- Defined in:
- lib/elk/number.rb
.allocate(parameters) ⇒ Object
Allocates a phone number
-
Required parameters: :country
-
Optional parameters: :sms_url, :voice_start_url, :client
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/elk/number.rb', line 73 def allocate(parameters) verify_parameters(parameters, [:country]) client = parameters.fetch(:client) { Elk.client } allowed_arguments = [:country, :sms_url, :voice_start_url] arguments = parameters.dup.select do |key, _| allowed_arguments.include?(key) end response = client.post('/Numbers', arguments) self.new(Elk::Util.parse_json(response.body)) end |