Class: Tenios::API::Number

Inherits:
Object
  • Object
show all
Defined in:
lib/tenios/api/number.rb

Constant Summary collapse

NUMBER_TYPES =
[
  GEOGRAPHICAL = "GEOGRAPHICAL"
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Number

Returns a new instance of Number.



8
9
10
# File 'lib/tenios/api/number.rb', line 8

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/tenios/api/number.rb', line 6

def client
  @client
end

Instance Method Details

#cancel(phone_number:) ⇒ Object



21
22
23
# File 'lib/tenios/api/number.rb', line 21

def cancel(phone_number:)
  client.post("/number/cancel", phone_number: phone_number)
end

#order(verification_id:, number_type: GEOGRAPHICAL, **options) ⇒ Object



16
17
18
19
# File 'lib/tenios/api/number.rb', line 16

def order(verification_id:, number_type: GEOGRAPHICAL, **options)
  payload = order_payload(verification_id: verification_id, number_type: number_type, **options)
  client.post("/number/order", **payload)
end