Class: Bagel::Video::Clip
- Inherits:
-
Object
- Object
- Bagel::Video::Clip
- Defined in:
- lib/bagel/video/clip.rb
Constant Summary collapse
- EXTENSION =
'.mp4'
Instance Attribute Summary collapse
-
#fade ⇒ Object
Returns the value of attribute fade.
-
#id ⇒ Object
Returns the value of attribute id.
-
#overlays ⇒ Object
Returns the value of attribute overlays.
Instance Method Summary collapse
- #clip_path ⇒ Object
- #duration ⇒ Object
-
#initialize(timeframe) ⇒ Clip
constructor
A new instance of Clip.
- #save ⇒ Object
- #start ⇒ Object
- #trim_path ⇒ Object
Constructor Details
#initialize(timeframe) ⇒ Clip
Returns a new instance of Clip.
8 9 10 11 12 13 |
# File 'lib/bagel/video/clip.rb', line 8 def initialize(timeframe) @id = nil @fade = nil @timeframe = timeframe @overlays = [] end |
Instance Attribute Details
#fade ⇒ Object
Returns the value of attribute fade.
3 4 5 |
# File 'lib/bagel/video/clip.rb', line 3 def fade @fade end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bagel/video/clip.rb', line 3 def id @id end |
#overlays ⇒ Object
Returns the value of attribute overlays.
3 4 5 |
# File 'lib/bagel/video/clip.rb', line 3 def @overlays end |
Instance Method Details
#clip_path ⇒ Object
31 32 33 |
# File 'lib/bagel/video/clip.rb', line 31 def clip_path File.join(Bagel.config.clip_dir, filename) end |
#duration ⇒ Object
23 24 25 |
# File 'lib/bagel/video/clip.rb', line 23 def duration timeframe.duration end |
#save ⇒ Object
15 16 17 |
# File 'lib/bagel/video/clip.rb', line 15 def save ClipSaver.new(self).save end |
#start ⇒ Object
19 20 21 |
# File 'lib/bagel/video/clip.rb', line 19 def start timeframe.start end |