Class: ID3Tag::FrameIdAdvisor

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

Constant Summary collapse

ANY_MAJOR_VERSION =
'x'
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,
    :unsychronized_transcription => :ULT,
    :image => :PIC
  },
  'v2.3' => {
    :artist => :TPE1,
    :title => :TIT2,
    :album => :TALB,
    :year => :TYER,
    :comments => :COMM,
    :genre => :TCON,
    :track_nr => :TRCK,
    :unsychronized_transcription => :USLT,
    :image => :APIC
  },
  'v2.4' => {
    :artist => :TPE1,
    :title => :TIT2,
    :album => :TALB,
    :year => :TDRC,
    :comments => :COMM,
    :genre => :TCON,
    :track_nr => :TRCK,
    :unsychronized_transcription => :USLT,
    :image => :APIC
  }
}

Instance Method Summary collapse

Constructor Details

#initialize(version, major_version) ⇒ FrameIdAdvisor

Returns a new instance of FrameIdAdvisor.



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

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

Instance Method Details

#advise(frame_name) ⇒ Object



54
55
56
# File 'lib/id3tag/frame_id_advisor.rb', line 54

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

#version_of_interestObject



58
59
60
# File 'lib/id3tag/frame_id_advisor.rb', line 58

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