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, source: nil, status: nil, error: nil, created_at: nil) ⇒ CustomVoice

Returns a new instance of CustomVoice.



236
237
238
239
240
241
242
243
244
# File 'lib/typecast/models.rb', line 236

def initialize(voice_id:, name:, model: nil, source: nil, status: nil, error: nil, created_at: nil)
  @voice_id = voice_id
  @name = name
  @model = model
  @source = source
  @status = status
  @error = error
  @created_at = created_at
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



230
231
232
# File 'lib/typecast/models.rb', line 230

def created_at
  @created_at
end

#errorObject (readonly)

Returns the value of attribute error.



230
231
232
# File 'lib/typecast/models.rb', line 230

def error
  @error
end

#modelObject (readonly)

Returns the value of attribute model.



230
231
232
# File 'lib/typecast/models.rb', line 230

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



230
231
232
# File 'lib/typecast/models.rb', line 230

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



230
231
232
# File 'lib/typecast/models.rb', line 230

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status.



230
231
232
# File 'lib/typecast/models.rb', line 230

def status
  @status
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



230
231
232
# File 'lib/typecast/models.rb', line 230

def voice_id
  @voice_id
end

Class Method Details

.from_h(hash) ⇒ Object



232
233
234
# File 'lib/typecast/models.rb', line 232

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