Class: SubtitleIt::Subline
- Inherits:
-
Object
- Object
- SubtitleIt::Subline
- Defined in:
- lib/subtitle_it/subline.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#text_off ⇒ Object
Returns the value of attribute text_off.
-
#text_on ⇒ Object
Returns the value of attribute text_on.
Instance Method Summary collapse
- #filter(*args) ⇒ Object
-
#initialize(text_on, text_off, text) ⇒ Subline
constructor
text_on/off may be: HH:MM:SS,MMM MM:SS S text lines should be separated by |.
Constructor Details
#initialize(text_on, text_off, text) ⇒ Subline
text_on/off may be: HH:MM:SS,MMM MM:SS S text lines should be separated by |
11 12 13 14 15 16 17 |
# File 'lib/subtitle_it/subline.rb', line 11 def initialize(text_on, text_off, text) @text_on, @text_off = filter(text_on, text_off) # ugly FIXME: when pseudo uses time => 3 # need to add seconds from the first sub @text_off += @text_on if @text_off < @text_on @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/subtitle_it/subline.rb', line 5 def text @text end |
#text_off ⇒ Object
Returns the value of attribute text_off.
5 6 7 |
# File 'lib/subtitle_it/subline.rb', line 5 def text_off @text_off end |
#text_on ⇒ Object
Returns the value of attribute text_on.
5 6 7 |
# File 'lib/subtitle_it/subline.rb', line 5 def text_on @text_on end |
Instance Method Details
#filter(*args) ⇒ Object
19 20 21 22 23 |
# File 'lib/subtitle_it/subline.rb', line 19 def filter(*args) args.map do |arg| Subtime.new(arg) end end |