Class: Typecast::Models::RecommendedVoice
- Inherits:
-
Object
- Object
- Typecast::Models::RecommendedVoice
- Defined in:
- lib/typecast/models.rb
Instance Attribute Summary collapse
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#voice_id ⇒ Object
readonly
Returns the value of attribute voice_id.
-
#voice_name ⇒ Object
readonly
Returns the value of attribute voice_name.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Recommendation results only include the matched voice ID, voice name, and similarity score.
Instance Method Summary collapse
-
#initialize(voice_id:, voice_name:, score:) ⇒ RecommendedVoice
constructor
A new instance of RecommendedVoice.
Constructor Details
#initialize(voice_id:, voice_name:, score:) ⇒ RecommendedVoice
Returns a new instance of RecommendedVoice.
196 197 198 199 200 |
# File 'lib/typecast/models.rb', line 196 def initialize(voice_id:, voice_name:, score:) @voice_id = voice_id @voice_name = voice_name @score = score end |
Instance Attribute Details
#score ⇒ Object (readonly)
Returns the value of attribute score.
183 184 185 |
# File 'lib/typecast/models.rb', line 183 def score @score end |
#voice_id ⇒ Object (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_name ⇒ Object (readonly)
Returns the value of attribute voice_name.
183 184 185 |
# File 'lib/typecast/models.rb', line 183 def voice_name @voice_name end |
Class Method Details
.from_h(hash) ⇒ Object
Recommendation results only include the matched voice ID, voice name, and similarity score. Use get_voice_v2 or get_voices_v2 to fetch detailed voice metadata for a returned voice_id.
188 189 190 191 192 193 194 |
# File 'lib/typecast/models.rb', line 188 def self.from_h(hash) new( voice_id: hash.fetch("voice_id", ""), voice_name: hash.fetch("voice_name", ""), score: hash.fetch("score", 0).to_f ) end |