Class: AudioTag::ID3::V2::FrameHeader

Inherits:
Header show all
Defined in:
lib/audio_tag/id3/v2/frame_header.rb

Constant Summary collapse

STRUCTURE =
%i[
  id id id id
  size size size size
  flags flags
].freeze

Instance Attribute Summary

Attributes inherited from Header

#bytes

Attributes inherited from StreamReader

#stream

Instance Method Summary collapse

Methods inherited from Header

#bytes_for

Methods inherited from StreamSection

#initialize

Methods inherited from StreamReader

#initialize, #read, #read!, #read_byte, #read_byte!, #read_bytes, #read_bytes!, #read_bytes_until, #read_bytes_until!, #read_until, #read_until!

Constructor Details

This class inherits a constructor from AudioTag::ID3::StreamSection

Instance Method Details

#frame_classObject



23
24
25
# File 'lib/audio_tag/id3/v2/frame_header.rb', line 23

def frame_class
  @frame_class ||= frame_type.frame_class
end

#frame_sizeObject



15
16
17
# File 'lib/audio_tag/id3/v2/frame_header.rb', line 15

def frame_size
  @frame_size ||= Synchsafe.parse(*bytes_for(:size))
end

#idObject



11
12
13
# File 'lib/audio_tag/id3/v2/frame_header.rb', line 11

def id
  @id ||= bytes_for(:id).pack("c*").to_sym
end

#keyObject



19
20
21
# File 'lib/audio_tag/id3/v2/frame_header.rb', line 19

def key
  @key ||= frame_type.name
end