Class: ID3Tag::Frames::V1::GenreFrame

Inherits:
Object
  • Object
show all
Defined in:
lib/id3tag/frames/v1/genre_frame.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, content) ⇒ GenreFrame

Returns a new instance of GenreFrame.



7
8
9
# File 'lib/id3tag/frames/v1/genre_frame.rb', line 7

def initialize(id, content)
 @id, @content = id, content
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/id3tag/frames/v1/genre_frame.rb', line 5

def id
  @id
end

Instance Method Details

#contentObject



11
12
13
14
# File 'lib/id3tag/frames/v1/genre_frame.rb', line 11

def content
  nr = @content.unpack(NumberUtil::FORMAT_FOR_8_BIT_SIGNED_INTEGER).first
  nr && Util::GenreNames.find_by_id(nr)
end