Class: Tenios::API::Number
- Inherits:
-
Object
- Object
- Tenios::API::Number
- Defined in:
- lib/tenios/api/number.rb
Constant Summary collapse
- NUMBER_TYPES =
[ GEOGRAPHICAL = "GEOGRAPHICAL" ].freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #cancel(phone_number:) ⇒ Object
-
#initialize(client) ⇒ Number
constructor
A new instance of Number.
- #order(verification_id:, number_type: GEOGRAPHICAL, **options) ⇒ Object
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
#client ⇒ Object (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, **) payload = order_payload(verification_id: verification_id, number_type: number_type, **) client.post("/number/order", **payload) end |