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) ⇒ Emotion

Returns a new instance of Emotion.

Raises:



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

def initialize(emotion)
  @type = emotion.downcase.to_sym

  raise EmotionNotAllowed, emotion unless emotion_known? @type
end

Instance Attribute Details

#typeSymbol (readonly)

Returns possible values: :evil, :good or :neutral.

Returns:

  • (Symbol)

    possible values: :evil, :good or :neutral



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

def type
  @type
end

Class Method Details

.listArray<String>

List of allowed emotions

Returns:

  • (Array<String>)


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

def self.list
  i(evil good neutral)
end