Class: Amdapi::PostCall
- Defined in:
- lib/amdapi/resources/post_call.rb
Constant Summary
Constants inherited from Resource
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(token, params, file, adapter, stubs) ⇒ PostCall
constructor
A new instance of PostCall.
Methods inherited from Resource
#delete_call, #get_all_request, #get_request, #post_audio_request, #post_call_request
Constructor Details
#initialize(token, params, file, adapter, stubs) ⇒ PostCall
Returns a new instance of PostCall.
7 8 9 10 11 |
# File 'lib/amdapi/resources/post_call.rb', line 7 def initialize(token, params, file, adapter, stubs) super(token, adapter: adapter, stubs: stubs) @params = params @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/amdapi/resources/post_call.rb', line 5 def file @file end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/amdapi/resources/post_call.rb', line 5 def params @params end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/amdapi/resources/post_call.rb', line 5 def token @token end |
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/amdapi/resources/post_call.rb', line 13 def create response = JSON.parse(post_call_request(params, headers: call_headers).body) call_url = response["data"]["url"] call_uuid = response["data"]["call_uuid"] post_audio_request(call_url, file, headers: audio_headers) Call.new call_uuid: call_uuid, token: token end |