Module: Id3Taginator::Frames::PrivateFrames
Instance Method Summary collapse
-
#private_frames ⇒ Array<Frames::Private::Entities::PrivateFrame>
extracts the private frames (PRIV).
-
#private_frames=(priv) ⇒ Object
(also: #add_private_frame)
adds a private frame (PRIV) Multiple ones can be added, as long as they have a different owner_id.
-
#remove_private_frame(owner_id) ⇒ Object
removes a pictures for the specific owner_id.
Methods included from Frameable
#find_frame, #find_frames, #set_frame_fields, #set_frame_fields_by_selector, #unsupported_frame
Instance Method Details
#private_frames ⇒ Array<Frames::Private::Entities::PrivateFrame>
extracts the private frames (PRIV)
11 12 13 14 15 16 |
# File 'lib/id3taginator/frames/private_frames.rb', line 11 def private_frames frame = find_frames(Private::PrivateFrame.frame_id(@major_version, @options)) return [] if frame.nil? || frame.empty? frame.map { |f| Private::Entities::PrivateFrame.new(f.owner_id, f.private_data) } end |
#private_frames=(priv) ⇒ Object Also known as: add_private_frame
adds a private frame (PRIV) Multiple ones can be added, as long as they have a different owner_id
22 23 24 25 26 |
# File 'lib/id3taginator/frames/private_frames.rb', line 22 def private_frames=(priv) set_frame_fields_by_selector(Private::PrivateFrame, %i[@owner_id @private_data], ->(f) { f.owner_id == priv.owner_id }, priv.owner_id, priv.private_data) end |
#remove_private_frame(owner_id) ⇒ Object
removes a pictures for the specific owner_id
33 34 35 36 37 |
# File 'lib/id3taginator/frames/private_frames.rb', line 33 def remove_private_frame(owner_id) @frames.delete_if do |f| f.frame_id == Private::PrivateFrame.frame_id(@major_version, @options) && f.owner_id == owner_id end end |