Class: AliDayu::Voice
Instance Attribute Summary
Attributes inherited from Base
#app_key, #app_secret, #post_url
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from AliDayu::Base
Instance Method Details
#deliver(*args) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ali_dayu/voice.rb', line 3 def deliver(*args) _telphones, _tts_param, _tts_code, _called_show_num, _extend = args = Time.now.strftime("%F %T") = { app_key: self.app_key, format: 'json', method: 'alibaba.aliqin.fc.tts.num.singlecall', partner_id: 'apidoc', sign_method: 'md5', timestamp: , v: '2.0', extend: _extend, tts_param: _tts_param.to_json, called_num: _telphones, called_show_num: _called_show_num, tts_code: _tts_code } = () puts "options: #{}" md5_str = encrypt() .merge!(sign: md5_str) response = post(self.post_url, .merge(sign: md5_str)) puts "phones: #{_telphones}, #{_tts_param}, and respone: #{response}" response end |