Module: Id3Taginator::Frames::HasId
- Included in:
- Buffer::RecommendedBufferSizeFrame, Comment::CommentFrame, Count::PlayCounterFrame, Count::PopularityFrame, Encryption::AudioEncryptionFrame, Encryption::EncryptionMethodFrame, Geo::GeneralEncapsulatedObjectFrame, Grouping::GroupIdentificationFrame, Grouping::GroupingFrame, Ipl::InvolvedPeopleFrame, Lyrics::UnsyncLyricsFrame, Mcdi::MusicCDIdentifierFrame, Picture::PictureFrame, Private::PrivateFrame, Text::AlbumArtistFrame, Text::AlbumFrame, Text::AlbumSortOrderFrame, Text::ArtistsFrame, Text::BPMFrame, Text::ComposerFrame, Text::ConductorFrame, Text::ContentGroupDescriptionFrame, Text::CopyrightFrame, Text::DateFrame, Text::EncodedByFrame, Text::EncoderFrame, Text::FileOwnerFrame, Text::FileTypeFrame, Text::GenreFrame, Text::ISRCFrame, Text::InitialKeyFrame, Text::InternetRadioStationFrame, Text::LanguageFrame, Text::LengthFrame, Text::MediaTypeFrame, Text::ModifiedByFrame, Text::OriginalAlbumFrame, Text::OriginalArtistsFrame, Text::OriginalFilenameFrame, Text::OriginalReleaseYearFrame, Text::OriginalWritersFrame, Text::PartOfSetFrame, Text::PerformerSortOrderFrame, Text::PlaylistDelayFrame, Text::PublisherFrame, Text::RecordingDatesFrame, Text::SizeFrame, Text::SubtitleFrame, Text::TimeFrame, Text::TitleFrame, Text::TitleSortOrderFrame, Text::TrackNumberFrame, Text::UserTextInfoFrame, Text::WritersFrame, Text::YearFrame, Tos::OwnershipFrame, Tos::TermsOfUseFrame, Ufid::UniqueFileIdentifierFrame, Url::CommercialUrlFrame, Url::CopyrightUrlFrame, Url::OfficialArtistWebpageFrame, Url::OfficialAudioRadioStationHomepageFrame, Url::OfficialFileWebpageFrame, Url::OfficialPublisherWebpageFrame, Url::OfficialSourceWebpageFrame, Url::PaymentUrlFrame, Url::UserUrlLinkFrame
- Defined in:
- lib/id3taginator/frames/has_id.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#frame_info(version2, version3, version4) ⇒ Object
creates a class method to return the frame id depending on the major id3tag version 3 and 4 return the 4 char Tag, 2 returns the version2 3 char Tag Additionally, a method to check if the version is supported is provided.
- #supported?(frame_name, version, options) ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/id3taginator/frames/has_id.rb', line 6 def self.included(base) base.extend(self) end |
Instance Method Details
#frame_info(version2, version3, version4) ⇒ Object
creates a class method to return the frame id depending on the major id3tag version 3 and 4 return the 4 char Tag, 2 returns the version2 3 char Tag Additionally, a method to check if the version is supported is provided.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/id3taginator/frames/has_id.rb', line 17 def frame_info(version2, version3, version4) define_singleton_method('frame_id') do |version = nil, = nil| result = nil result = version3 if version.nil? result = version2 if version == 2 result = version3 if version == 3 result = version4 if version == 4 result = version4 if version == 3 && &.ignore_v23_frame_error && result.nil? result = version3 if version == 4 && &.ignore_v24_frame_error && result.nil? result end end |
#supported?(frame_name, version, options) ⇒ Boolean
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/id3taginator/frames/has_id.rb', line 33 def supported?(frame_name, version, ) frame_id = frame_id(version) return true unless frame_id.nil? if version == 3 && &.ignore_v23_frame_error v4_frame_id = frame_id(4) return true unless v4_frame_id.nil? end if version == 4 && &.ignore_v24_frame_error v3_frame_id = frame_id(3) return true unless v3_frame_id.nil? end raise Errors::Id3TagError, "#{frame_name} not supported by Id3v2.#{version}" end |