Class: YandexSpeechApi::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/yandex_speech/format.rb

Defined Under Namespace

Classes: FormatNotAllowed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format) ⇒ Format

Returns a new instance of Format.

Raises:



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

#typeSymbol (readonly)

Returns possible values: :mp3, :wav or :opus.

Returns:

  • (Symbol)

    possible values: :mp3, :wav or :opus



18
19
20
# File 'lib/yandex_speech/format.rb', line 18

def type
  @type
end

Class Method Details

.listArray<String>

List of allowed formats

Returns:

  • (Array<String>)


11
12
13
# File 'lib/yandex_speech/format.rb', line 11

def self.list
  %i(mp3 wav opus)
end