Class: ID3Tag::FrameIdAdvisor

Inherits:
Object
  • Object
show all
Defined in:
lib/id3tag/frame_id_advisor.rb

Constant Summary collapse

COMMON_FRAME_IDS_BY_VERSION =
{
  'v1.x' => {
    :artist => :artist,
    :title => :title,
    :album => :album,
    :year => :year,
    :comments => :comments,
    :genre => :genre,
    :track_nr => :track_nr
  },
  'v2.2' => {
    :artist => :TP1,
    :title => :TT2,
    :album => :TAL,
    :year => :TYE,
    :comments => :COM,
    :genre => :TCO,
    :track_nr => :TRK
  },
  'v2.3' => {
    :artist => :TPE1,
    :title => :TIT2,
    :album => :TALB,
    :year => :TYER,
    :comments => :COMM,
    :genre => :TCON,
    :track_nr => :TRCK
  },
  'v2.4' => {
    :artist => :TPE1,
    :title => :TIT2,
    :album => :TALB,
    :year => :TDRC,
    :comments => :COMM,
    :genre => :TCON,
    :track_nr => :TRCK
  }
}

Instance Method Summary collapse

Constructor Details

#initialize(version, major_version) ⇒ FrameIdAdvisor

Returns a new instance of FrameIdAdvisor.



42
43
44
# File 'lib/id3tag/frame_id_advisor.rb', line 42

def initialize(version, major_version)
  @version, @major_version = version, major_version
end

Instance Method Details

#advise(frame_name) ⇒ Object



46
47
48
# File 'lib/id3tag/frame_id_advisor.rb', line 46

def advise(frame_name)
  version_ids && version_ids[frame_name]
end

#version_of_interestObject



50
51
52
# File 'lib/id3tag/frame_id_advisor.rb', line 50

def version_of_interest
  "v#{@version}.#{@major_version}"
end