Class: AzureSTT::Transcription
- Inherits:
-
Models::Base
- Object
- Dry::Struct
- Models::Base
- AzureSTT::Transcription
- Defined in:
- lib/azure_stt/transcription.rb
Overview
Model for a transcription. Contains the results and static methods to create and retrieve the transcriptions.
Instance Method Summary collapse
-
#failed? ⇒ Boolean
Is the status is failed ?.
-
#finished? ⇒ Boolean
Is the process finished ? (Succeeded or failed).
-
#report ⇒ Models::Report
Get the report of a transcription from transcriptions/id/files route.
-
#results ⇒ Array[Models::Result]
Get the results of a transcription.
-
#running? ⇒ Boolean
Is the process still running ?.
-
#succeeded? ⇒ Boolean
Has the process succeeded ?.
Instance Method Details
#failed? ⇒ Boolean
Is the status is failed ?
35 36 37 |
# File 'lib/azure_stt/transcription.rb', line 35 def failed? status == 'Failed' end |
#finished? ⇒ Boolean
Is the process finished ? (Succeeded or failed)
53 54 55 |
# File 'lib/azure_stt/transcription.rb', line 53 def finished? succeeded? || failed? end |
#report ⇒ Models::Report
Get the report of a transcription from transcriptions/id/files route
64 65 66 |
# File 'lib/azure_stt/transcription.rb', line 64 def report @report ||= retrieve_report end |
#results ⇒ Array[Models::Result]
Get the results of a transcription. The results are the files containing the speech-to-text. As a transcription process can have multiple files, the results are in an Array.
75 76 77 |
# File 'lib/azure_stt/transcription.rb', line 75 def results @results ||= retrieve_results end |
#running? ⇒ Boolean
Is the process still running ?
26 27 28 |
# File 'lib/azure_stt/transcription.rb', line 26 def running? status == 'Running' end |
#succeeded? ⇒ Boolean
Has the process succeeded ?
44 45 46 |
# File 'lib/azure_stt/transcription.rb', line 44 def succeeded? status == 'Succeeded' end |