Class: Typecast::Models::VoiceV3

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:, voice_type:, gender: nil, age: nil, use_cases: [], preview_url: nil) ⇒ VoiceV3

Returns a new instance of VoiceV3.



187
188
189
190
# File 'lib/typecast/models.rb', line 187

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

Instance Attribute Details

#ageObject (readonly)

Returns the value of attribute age.



183
184
185
# File 'lib/typecast/models.rb', line 183

def age
  @age
end

#genderObject (readonly)

Returns the value of attribute gender.



183
184
185
# File 'lib/typecast/models.rb', line 183

def gender
  @gender
end

#modelsObject (readonly)

Returns the value of attribute models.



183
184
185
# File 'lib/typecast/models.rb', line 183

def models
  @models
end

#preview_urlObject (readonly)

Returns the value of attribute preview_url.



183
184
185
# File 'lib/typecast/models.rb', line 183

def preview_url
  @preview_url
end

#use_casesObject (readonly)

Returns the value of attribute use_cases.



183
184
185
# File 'lib/typecast/models.rb', line 183

def use_cases
  @use_cases
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



183
184
185
# File 'lib/typecast/models.rb', line 183

def voice_id
  @voice_id
end

#voice_nameObject (readonly)

Returns the value of attribute voice_name.



183
184
185
# File 'lib/typecast/models.rb', line 183

def voice_name
  @voice_name
end

#voice_typeObject (readonly)

Returns the value of attribute voice_type.



183
184
185
# File 'lib/typecast/models.rb', line 183

def voice_type
  @voice_type
end

Class Method Details

.from_h(hash) ⇒ Object



184
185
186
# File 'lib/typecast/models.rb', line 184

def self.from_h(hash)
  new(voice_id: hash.fetch("voice_id", ""), voice_name: hash.fetch("voice_name", { "eng" => "", "kor" => "" }), models: hash.fetch("models", []), voice_type: hash.fetch("voice_type", ""), gender: hash["gender"], age: hash["age"], use_cases: hash.fetch("use_cases", []), preview_url: hash["preview_url"])
end