Class: Teems::Commands::TranscriptFormatter
- Inherits:
-
Object
- Object
- Teems::Commands::TranscriptFormatter
- Defined in:
- lib/teems/commands/meeting_transcript.rb
Overview
Converts JSON transcript entries to WebVTT with speaker names
Instance Method Summary collapse
-
#initialize(entries) ⇒ TranscriptFormatter
constructor
A new instance of TranscriptFormatter.
- #to_vtt ⇒ Object
Constructor Details
#initialize(entries) ⇒ TranscriptFormatter
Returns a new instance of TranscriptFormatter.
115 116 117 118 |
# File 'lib/teems/commands/meeting_transcript.rb', line 115 def initialize(entries) @entries = entries @cue = nil end |
Instance Method Details
#to_vtt ⇒ Object
120 121 122 123 |
# File 'lib/teems/commands/meeting_transcript.rb', line 120 def to_vtt cues = @entries.each_with_index.map { |entry, idx| format_cue(entry, idx) } "WEBVTT\n\n#{cues.join}" end |