Class: M4S::Layout::Atom
- Inherits:
-
Object
- Object
- M4S::Layout::Atom
- Defined in:
- lib/m4s/layout/atom.rb
Direct Known Subclasses
Ctts, Dinf, Elst, Ftyp, Hdlr, Mdat, Mdhd, Mfhd, Mvhd, Sidx, Stco, Stsc, Stsd, Stss, Stsz, Stts, Styp, Tfdt, Tfhd, Tkhd, Trex, Trun, VSmhd
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#segment_index ⇒ Object
Returns the value of attribute segment_index.
-
#track ⇒ Object
Returns the value of attribute track.
-
#track_id ⇒ Object
Returns the value of attribute track_id.
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(cache, opts = {}) ⇒ Atom
constructor
A new instance of Atom.
Constructor Details
#initialize(cache, opts = {}) ⇒ Atom
Returns a new instance of Atom.
9 10 11 12 13 14 |
# File 'lib/m4s/layout/atom.rb', line 9 def initialize(cache, opts = {}) @cache = cache @track = opts.fetch(:track, nil) @track_id = track.fetch('track_id') if track @segment_index = opts.fetch(:segment_index, nil) end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
3 4 5 |
# File 'lib/m4s/layout/atom.rb', line 3 def cache @cache end |
#segment_index ⇒ Object
Returns the value of attribute segment_index.
3 4 5 |
# File 'lib/m4s/layout/atom.rb', line 3 def segment_index @segment_index end |
#track ⇒ Object
Returns the value of attribute track.
3 4 5 |
# File 'lib/m4s/layout/atom.rb', line 3 def track @track end |
#track_id ⇒ Object
Returns the value of attribute track_id.
3 4 5 |
# File 'lib/m4s/layout/atom.rb', line 3 def track_id @track_id end |
Class Method Details
.generate(cache, opts = {}) ⇒ Object
5 6 7 |
# File 'lib/m4s/layout/atom.rb', line 5 def self.generate(cache, opts = {}) new(cache, opts).generate end |
Instance Method Details
#generate ⇒ Object
16 17 18 19 20 21 |
# File 'lib/m4s/layout/atom.rb', line 16 def generate [ *header, binary_content, ].join end |