Class: BoundioV2::AudioFile
- Defined in:
- lib/boundioV2/audio_file.rb
Defined Under Namespace
Classes: InsufficientParametersOrTooBigFile, VoiceConversionError
Instance Attribute Summary collapse
-
#convtext ⇒ Object
Returns the value of attribute convtext.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
Constructor Details
This class inherits a constructor from BoundioV2::Resource
Instance Attribute Details
#convtext ⇒ Object
Returns the value of attribute convtext.
3 4 5 |
# File 'lib/boundioV2/audio_file.rb', line 3 def convtext @convtext end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/boundioV2/audio_file.rb', line 3 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/boundioV2/audio_file.rb', line 3 def id @id end |
Class Method Details
.api_version ⇒ Object
5 6 7 |
# File 'lib/boundioV2/audio_file.rb', line 5 def self.api_version "vd2" end |
.exceptions ⇒ Object
9 10 11 |
# File 'lib/boundioV2/audio_file.rb', line 9 def self.exceptions super.merge(2 => InsufficientParametersOrTooBigFile, 6 => VoiceConversionError) end |
Instance Method Details
#+(file) ⇒ Object
24 25 26 |
# File 'lib/boundioV2/audio_file.rb', line 24 def +(file) BoundioV2::Cast.new(self, file) end |
#save ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/boundioV2/audio_file.rb', line 13 def save args = if file { :file => file, :filename => File.basename(file.path) } else { :convtext => convtext, :filename => convtext } end res = self.class.request :post, "/file/post", args self.id = res["fileid"] true end |