Class: Webvtt::Cue
- Inherits:
-
Object
- Object
- Webvtt::Cue
- Defined in:
- lib/webvtt/cue.rb
Instance Attribute Summary collapse
-
#end ⇒ Object
Returns the value of attribute end.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#start ⇒ Object
Returns the value of attribute start.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Cue
constructor
A new instance of Cue.
Constructor Details
#initialize(opts = {}) ⇒ Cue
Returns a new instance of Cue.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/webvtt/cue.rb', line 5 def initialize(opts={}) if !opts.empty? @identifier = opts[:identifier] @text = opts[:text] cue_parts = opts[:cue_line].split('-->') @start = cue_parts.first.strip remaining_cue_parts = cue_parts.last.split(" ") @end = remaining_cue_parts.shift.strip @settings = remaining_cue_parts.join(' ') end end |
Instance Attribute Details
#end ⇒ Object
Returns the value of attribute end.
4 5 6 |
# File 'lib/webvtt/cue.rb', line 4 def end @end end |
#identifier ⇒ Object
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/webvtt/cue.rb', line 4 def identifier @identifier end |
#settings ⇒ Object
Returns the value of attribute settings.
4 5 6 |
# File 'lib/webvtt/cue.rb', line 4 def settings @settings end |
#start ⇒ Object
Returns the value of attribute start.
4 5 6 |
# File 'lib/webvtt/cue.rb', line 4 def start @start end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/webvtt/cue.rb', line 4 def text @text end |