Class: Typecast::Models::VoiceV2

Inherits:
Object
  • Object
show all
Defined in:
lib/typecast/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voice_id:, voice_name:, models:, gender: nil, age: nil, use_cases: []) ⇒ VoiceV2

Returns a new instance of VoiceV2.



182
183
184
185
186
187
188
189
# File 'lib/typecast/models.rb', line 182

def initialize(voice_id:, voice_name:, models:, gender: nil, age: nil, use_cases: [])
  @voice_id = voice_id
  @voice_name = voice_name
  @models = models
  @gender = gender
  @age = age
  @use_cases = use_cases
end

Instance Attribute Details

#age ⇒ Object (readonly)

Returns the value of attribute age.



169
170
171
# File 'lib/typecast/models.rb', line 169

def age
  @age
end

#gender ⇒ Object (readonly)

Returns the value of attribute gender.



169
170
171
# File 'lib/typecast/models.rb', line 169

def gender
  @gender
end

#models ⇒ Object (readonly)

Returns the value of attribute models.



169
170
171
# File 'lib/typecast/models.rb', line 169

def models
  @models
end

#use_cases ⇒ Object (readonly)

Returns the value of attribute use_cases.



169
170
171
# File 'lib/typecast/models.rb', line 169

def use_cases
  @use_cases
end

#voice_id ⇒ Object (readonly)

Returns the value of attribute voice_id.



169
170
171
# File 'lib/typecast/models.rb', line 169

def voice_id
  @voice_id
end

#voice_name ⇒ Object (readonly)

Returns the value of attribute voice_name.



169
170
171
# File 'lib/typecast/models.rb', line 169

def voice_name
  @voice_name
end

Class Method Details

.from_h(hash) ⇒ Object



171
172
173
174
175
176
177
178
179
180
# File 'lib/typecast/models.rb', line 171

def self.from_h(hash)
  new(
    voice_id: hash.fetch("voice_id", ""),
    voice_name: hash.fetch("voice_name", ""),
    models: hash.fetch("models", []),
    gender: hash["gender"],
    age: hash["age"],
    use_cases: hash.fetch("use_cases", [])
  )
end