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.



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

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

#ageObject (readonly)

Returns the value of attribute age.



159
160
161
# File 'lib/typecast/models.rb', line 159

def age
  @age
end

#genderObject (readonly)

Returns the value of attribute gender.



159
160
161
# File 'lib/typecast/models.rb', line 159

def gender
  @gender
end

#modelsObject (readonly)

Returns the value of attribute models.



159
160
161
# File 'lib/typecast/models.rb', line 159

def models
  @models
end

#use_casesObject (readonly)

Returns the value of attribute use_cases.



159
160
161
# File 'lib/typecast/models.rb', line 159

def use_cases
  @use_cases
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



159
160
161
# File 'lib/typecast/models.rb', line 159

def voice_id
  @voice_id
end

#voice_nameObject (readonly)

Returns the value of attribute voice_name.



159
160
161
# File 'lib/typecast/models.rb', line 159

def voice_name
  @voice_name
end

Class Method Details

.from_h(hash) ⇒ Object



161
162
163
164
165
166
167
168
169
170
# File 'lib/typecast/models.rb', line 161

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