Class: ID3Tag::ID3v2TagHeader
- Inherits:
-
Object
- Object
- ID3Tag::ID3v2TagHeader
- Defined in:
- lib/id3tag/id3_v2_tag_header.rb
Instance Method Summary collapse
- #experimental? ⇒ Boolean
- #extended_header? ⇒ Boolean
- #footer_present? ⇒ Boolean
-
#initialize(header_chunk) ⇒ ID3v2TagHeader
constructor
A new instance of ID3v2TagHeader.
- #inspect ⇒ Object
- #major_version_number ⇒ Object
- #minor_version_number ⇒ Object
- #tag_size ⇒ Object
- #unsynchronisation? ⇒ Boolean
- #version_number ⇒ Object
Constructor Details
#initialize(header_chunk) ⇒ ID3v2TagHeader
Returns a new instance of ID3v2TagHeader.
3 4 5 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 3 def initialize(header_chunk) @content = StringIO.new(header_chunk) end |
Instance Method Details
#experimental? ⇒ Boolean
29 30 31 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 29 def experimental? flags_byte[5] == 1 end |
#extended_header? ⇒ Boolean
25 26 27 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 25 def extended_header? flags_byte[6] == 1 end |
#footer_present? ⇒ Boolean
33 34 35 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 33 def flags_byte[4] == 1 end |
#inspect ⇒ Object
41 42 43 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 41 def inspect "<#{self.class.name} version:2.#{version_number} size:#{tag_size} unsync:#{unsynchronisation?} ext.header:#{extended_header?} experimental:#{experimental?} footer:#{}>" end |
#major_version_number ⇒ Object
7 8 9 10 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 7 def major_version_number @content.seek(3) @content.readbyte end |
#minor_version_number ⇒ Object
12 13 14 15 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 12 def minor_version_number @content.seek(4) @content.readbyte end |
#tag_size ⇒ Object
37 38 39 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 37 def tag_size @tag_size ||= get_tag_size end |
#unsynchronisation? ⇒ Boolean
21 22 23 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 21 def unsynchronisation? flags_byte[7] == 1 end |
#version_number ⇒ Object
17 18 19 |
# File 'lib/id3tag/id3_v2_tag_header.rb', line 17 def version_number sprintf("%s.%s", major_version_number, minor_version_number) end |