Class: Tenios::API::TransferCall
- Inherits:
-
Object
- Object
- Tenios::API::TransferCall
- Defined in:
- lib/tenios/api/transfer_call.rb
Constant Summary collapse
- EXTERNAL_NUMBER =
"EXTERNALNUMBER"
- SIP_USER =
"SIP_USER"
- SIP_TRUNK =
"SIP_TRUNK"
- DESTINATION_TYPES =
[ EXTERNAL_NUMBER, SIP_USER, SIP_TRUNK ].freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ TransferCall
constructor
A new instance of TransferCall.
- #transfer_call(call_uuid:, destination:, destination_type: EXTERNAL_NUMBER) ⇒ Object
Constructor Details
#initialize(client) ⇒ TransferCall
Returns a new instance of TransferCall.
18 19 20 |
# File 'lib/tenios/api/transfer_call.rb', line 18 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
16 17 18 |
# File 'lib/tenios/api/transfer_call.rb', line 16 def client @client end |
Instance Method Details
#transfer_call(call_uuid:, destination:, destination_type: EXTERNAL_NUMBER) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tenios/api/transfer_call.rb', line 22 def transfer_call(call_uuid:, destination:, destination_type: EXTERNAL_NUMBER) raise "destination_type must be one of #{DESTINATION_TYPES}" unless DESTINATION_TYPES.include?(destination_type) client.post( "/transfer-call", call_uuid: call_uuid, destination_type: destination_type, destination: destination ) end |