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

Instance Method Summary collapse

Constructor Details

#initialize(version, major_version) ⇒ FrameIdAdvisor

Returns a new instance of FrameIdAdvisor.



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

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

Instance Method Details

#advise(frame_name) ⇒ Object



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

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

#version_of_interestObject



61
62
63
# File 'lib/id3tag/frame_id_advisor.rb', line 61

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