Class: AudioTag::ID3::Header

Inherits:
StreamSection show all
Defined in:
lib/audio_tag/id3/header.rb

Direct Known Subclasses

V2::FrameHeader, V2::TagHeader

Instance Attribute Summary collapse

Attributes inherited from StreamReader

#stream

Instance Method Summary collapse

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 Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes.



4
5
6
# File 'lib/audio_tag/id3/header.rb', line 4

def bytes
  @bytes
end

Instance Method Details

#bytes_for(key) ⇒ Object



6
7
8
9
10
11
# File 'lib/audio_tag/id3/header.rb', line 6

def bytes_for(key)
  first = structure.index(key) || raise("invalid key :#{key}")
  last  = structure.rindex(key)

  bytes[first..last] || raise
end