Class: WahWah::ID3::FrameBody

Inherits:
Object
  • Object
show all
Defined in:
lib/wahwah/id3/frame_body.rb

Direct Known Subclasses

CommentFrameBody, ImageFrameBody, TextFrameBody

Constant Summary collapse

ENCODING_MAPPING =

Textual frames are marked with an encoding byte.

$00 ISO-8859-1 [ISO-8859-1]. Terminated with $00. $01 UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM. $02 UTF-16BE [UTF-16] encoded Unicode [UNICODE] without BOM. $03 UTF-8 [UTF-8] encoded Unicode [UNICODE].

%w[ISO-8859-1 UTF-16 UTF-16BE UTF-8]
ENCODING_TERMINATOR_SIZE =
{
  "ISO-8859-1" => 1,
  "UTF-16" => 2,
  "UTF-16BE" => 2,
  "UTF-8" => 1
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, version) ⇒ FrameBody

Returns a new instance of FrameBody.



23
24
25
26
27
28
# File 'lib/wahwah/id3/frame_body.rb', line 23

def initialize(content, version)
  @content = content
  @version = version

  parse
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21
22
23
# File 'lib/wahwah/id3/frame_body.rb', line 21

def value
  @value
end

Instance Method Details

#parseObject



30
31
32
# File 'lib/wahwah/id3/frame_body.rb', line 30

def parse
  raise WahWahNotImplementedError, "The parse method is not implemented"
end