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.



197
198
199
200
# File 'lib/typecast/models.rb', line 197

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

#age ⇒ Object (readonly)

Returns the value of attribute age.



193
194
195
# File 'lib/typecast/models.rb', line 193

def age
  @age
end

#gender ⇒ Object (readonly)

Returns the value of attribute gender.



193
194
195
# File 'lib/typecast/models.rb', line 193

def gender
  @gender
end

#models ⇒ Object (readonly)

Returns the value of attribute models.



193
194
195
# File 'lib/typecast/models.rb', line 193

def models
  @models
end

#preview_url ⇒ Object (readonly)

Returns the value of attribute preview_url.



193
194
195
# File 'lib/typecast/models.rb', line 193

def preview_url
  @preview_url
end

#use_cases ⇒ Object (readonly)

Returns the value of attribute use_cases.



193
194
195
# File 'lib/typecast/models.rb', line 193

def use_cases
  @use_cases
end

#voice_id ⇒ Object (readonly)

Returns the value of attribute voice_id.



193
194
195
# File 'lib/typecast/models.rb', line 193

def voice_id
  @voice_id
end

#voice_name ⇒ Object (readonly)

Returns the value of attribute voice_name.



193
194
195
# File 'lib/typecast/models.rb', line 193

def voice_name
  @voice_name
end

#voice_type ⇒ Object (readonly)

Returns the value of attribute voice_type.



193
194
195
# File 'lib/typecast/models.rb', line 193

def voice_type
  @voice_type
end

Class Method Details

.from_h(hash) ⇒ Object



194
195
196
# File 'lib/typecast/models.rb', line 194

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