Class: YandexSpeechApi::Voice

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

Defined Under Namespace

Classes: VoiceNotAllowed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voice = :jane) ⇒ Voice

Returns a new instance of Voice

Raises:


29
30
31
32
# File 'lib/yandex_speech/voice.rb', line 29

def initialize(voice = :jane)
  @name = voice.downcase.to_sym
  raise VoiceNotAllowed, voice unless voice_known? @name
end

Instance Attribute Details

#nameSymbol (readonly)


27
28
29
# File 'lib/yandex_speech/voice.rb', line 27

def name
  @name
end

Class Method Details

.listArray<String>

List of allowed voices


17
18
19
# File 'lib/yandex_speech/voice.rb', line 17

def self.list
  i(jane oksana alyss omazh zahar ermil)
end