Class: YandexSpeechApi::Emotion

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

Defined Under Namespace

Classes: EmotionNotAllowed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(emotion = :neutral) ⇒ Emotion

Returns a new instance of Emotion

Raises:


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

def initialize(emotion = :neutral)
  @type = emotion.downcase.to_sym
  raise EmotionNotAllowed, emotion unless emotion_known? @type
end

Instance Attribute Details

#typeSymbol (readonly)


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

def type
  @type
end

Class Method Details

.listArray<String>

List of allowed emotions


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

def self.list
  i(evil good neutral)
end