Class: WebVTT::Cue
- Inherits:
-
Object
- Object
- WebVTT::Cue
- Defined in:
- lib/vtt2an/webvtt/cue.rb
Constant Summary collapse
- VOICE_SPAN_REGEX =
/<v\.?([\w\.]*?) (.*?)\>(.*)/
Instance Method Summary collapse
Instance Method Details
#raw_text ⇒ Object
10 |
# File 'lib/vtt2an/webvtt/cue.rb', line 10 alias_method :raw_text, :text |
#speaker ⇒ Object
5 6 7 8 |
# File 'lib/vtt2an/webvtt/cue.rb', line 5 def speaker raw_text =~ VOICE_SPAN_REGEX $2 || "Speaker" end |
#text ⇒ Object
12 13 14 15 |
# File 'lib/vtt2an/webvtt/cue.rb', line 12 def text raw_text =~ VOICE_SPAN_REGEX $3 || raw_text end |
#voice_span ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/vtt2an/webvtt/cue.rb', line 17 def voice_span raw_text =~ VOICE_SPAN_REGEX if $1 $1.split(".") else [] end end |