Class: YandexSpeechApi::Voice

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

Overview

Examples:

Valid Usage

Voice.new('Oksana') # ==> instance of voice class

Bad Usage

Voice.new(:bill)    # ==> VoiceNotAllowed exception

Defined Under Namespace

Classes: VoiceNotAllowed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voice) ⇒ Voice

Returns a new instance of Voice.

Raises:



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

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

Instance Attribute Details

#nameSymbol (readonly)

Returns possible values: :jane, :oksana, :alyss, :omazh, :zahar, :ermil.

Returns:

  • (Symbol)

    possible values: :jane, :oksana, :alyss, :omazh, :zahar, :ermil



25
26
27
# File 'lib/yandex_speech/voice.rb', line 25

def name
  @name
end

Class Method Details

.listArray<String>

List of allowed voices

Returns:

  • (Array<String>)


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

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