Class: Id3Taginator::Header::Id3v23ExtendedHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/id3taginator/header/id3v23_extended_header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size, flags, padding, crc_data = nil) ⇒ Id3v23ExtendedHeader

constructor

Parameters:

  • size (Integer)

    the size of the extended header

  • flags (String)

    2 byte Array as a String representing the flags

  • padding (Integer)

    the number of padding of the extended header

  • crc_data (String) (defaults to: nil)

    the crc data if present



15
16
17
18
19
20
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 15

def initialize(size, flags, padding, crc_data = nil)
  @size = size
  @flags = flags
  @padding = padding
  @crc_data = crc_data
end

Instance Attribute Details

#crc_dataObject

Returns the value of attribute crc_data.



7
8
9
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 7

def crc_data
  @crc_data
end

#flagsObject

Returns the value of attribute flags.



7
8
9
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 7

def flags
  @flags
end

#paddingObject

Returns the value of attribute padding.



7
8
9
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 7

def padding
  @padding
end

#sizeObject

Returns the value of attribute size.



7
8
9
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 7

def size
  @size
end

Instance Method Details

#crcString?

returns the CRC data if present

Returns:

  • (String, nil)

    the CRC data



25
26
27
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 25

def crc
  @crc_data
end

#crc?Boolean

determined if the crc is present

Returns:

  • (Boolean)

    true if crc is present, else false



32
33
34
# File 'lib/id3taginator/header/id3v23_extended_header.rb', line 32

def crc?
  (@flags[0] & 0b10000000) == 0b10000000
end