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 = :mp3) ⇒ Format

Returns a new instance of Format

Raises:


22
23
24
25
# File 'lib/yandex_speech/format.rb', line 22

def initialize(format = :mp3)
  @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


20
21
22
# File 'lib/yandex_speech/format.rb', line 20

def type
  @type
end

Class Method Details

.listArray<String>

List of allowed formats

Returns:

  • (Array<String>)

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

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