Class: YandexSpeechApi::Format
- Inherits:
-
Object
- Object
- YandexSpeechApi::Format
- Defined in:
- lib/yandex_speech/format.rb
Defined Under Namespace
Classes: FormatNotAllowed
Instance Attribute Summary collapse
-
#type ⇒ Symbol
readonly
Possible values: :mp3, :wav or :opus.
Class Method Summary collapse
-
.list ⇒ Array<String>
List of allowed formats.
Instance Method Summary collapse
-
#initialize(format) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(format) ⇒ Format
Returns a new instance of Format.
20 21 22 23 24 |
# File 'lib/yandex_speech/format.rb', line 20 def initialize(format) @type = format.downcase.to_sym raise FormatNotAllowed, format unless format_known? @type end |
Instance Attribute Details
#type ⇒ Symbol (readonly)
Returns possible values: :mp3, :wav or :opus.
18 19 20 |
# File 'lib/yandex_speech/format.rb', line 18 def type @type end |
Class Method Details
.list ⇒ Array<String>
List of allowed formats
11 12 13 |
# File 'lib/yandex_speech/format.rb', line 11 def self.list %i(mp3 wav opus) end |