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.



165
166
167
168
169
170
171
172
# File 'lib/typecast/models.rb', line 165

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.



152
153
154
# File 'lib/typecast/models.rb', line 152

def age
  @age
end

#genderObject (readonly)

Returns the value of attribute gender.



152
153
154
# File 'lib/typecast/models.rb', line 152

def gender
  @gender
end

#modelsObject (readonly)

Returns the value of attribute models.



152
153
154
# File 'lib/typecast/models.rb', line 152

def models
  @models
end

#use_casesObject (readonly)

Returns the value of attribute use_cases.



152
153
154
# File 'lib/typecast/models.rb', line 152

def use_cases
  @use_cases
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



152
153
154
# File 'lib/typecast/models.rb', line 152

def voice_id
  @voice_id
end

#voice_nameObject (readonly)

Returns the value of attribute voice_name.



152
153
154
# File 'lib/typecast/models.rb', line 152

def voice_name
  @voice_name
end

Class Method Details

.from_h(hash) ⇒ Object



154
155
156
157
158
159
160
161
162
163
# File 'lib/typecast/models.rb', line 154

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