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.



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

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.



191
192
193
# File 'lib/typecast/models.rb', line 191

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



191
192
193
# File 'lib/typecast/models.rb', line 191

def name
  @name
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



191
192
193
# File 'lib/typecast/models.rb', line 191

def voice_id
  @voice_id
end

Class Method Details

.from_h(hash) ⇒ Object



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

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