Class: Typecast::Models::CustomVoice

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:, name:, model: nil) ⇒ CustomVoice

Returns a new instance of CustomVoice.



225
226
227
228
229
# File 'lib/typecast/models.rb', line 225

def initialize(voice_id:, name:, model: nil)
  @voice_id = voice_id
  @name = name
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



219
220
221
# File 'lib/typecast/models.rb', line 219

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



219
220
221
# File 'lib/typecast/models.rb', line 219

def name
  @name
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



219
220
221
# File 'lib/typecast/models.rb', line 219

def voice_id
  @voice_id
end

Class Method Details

.from_h(hash) ⇒ Object



221
222
223
# File 'lib/typecast/models.rb', line 221

def self.from_h(hash)
  new(voice_id: hash.fetch("voice_id", ""), name: hash.fetch("name", ""), model: hash["model"])
end