Class: VoxableApiAiRuby::VoiceRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/voxable-api-ai-ruby/voice_request.rb

Instance Attribute Summary

Attributes inherited from Request

#client, #headers, #options, #request_method, #uri

Instance Method Summary collapse

Methods inherited from Request

#perform

Constructor Details

#initialize(client, options = {}) ⇒ VoxableApiAiRuby::VoiceRequest

Parameters:



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/voxable-api-ai-ruby/voice_request.rb', line 8

def initialize(client,  options = {})
  @path = 'query'

  super client, options

  file = options.delete(:file)
  options = {
      :request => options.to_json,
      :voiceData => HTTP::FormData::File.new(file, filename: File.basename(file))
  }
  @options = options

  self
end