Module: Id3Taginator::Frames::ToSFrames
Instance Method Summary collapse
-
#ownership ⇒ Frames::Tos::Entities::Ownership?
extracts the ownership frame (OWNE).
-
#ownership=(ownership) ⇒ Object
sets the ownership frame (OWNE).
-
#remove_ownership ⇒ Object
removes the ownership frame.
-
#remove_terms_of_use ⇒ Object
removes the terms of use frame.
-
#terms_of_use ⇒ Frames::Tos::Entities::TermsOfUse?
extracts the terms of use frame (USER).
-
#terms_of_use=(tou) ⇒ Object
sets the terms of use frame (USER).
Methods included from Frameable
#find_frame, #find_frames, #set_frame_fields, #set_frame_fields_by_selector, #unsupported_frame
Instance Method Details
#ownership ⇒ Frames::Tos::Entities::Ownership?
extracts the ownership frame (OWNE)
33 34 35 36 37 38 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 33 def ownership frame = find_frame(Tos::OwnershipFrame.frame_id(@major_version, )) return nil if frame.nil? Frames::Tos::Entities::Ownership.new(frame.price_paid, frame.date_of_purchase, frame.seller) end |
#ownership=(ownership) ⇒ Object
sets the ownership frame (OWNE)
43 44 45 46 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 43 def ownership=(ownership) set_frame_fields(Tos::OwnershipFrame, i[@price_paid @date_of_purchase @seller], ownership.price_paid, ownership.date_of_purchase, ownership.seller) end |
#remove_ownership ⇒ Object
removes the ownership frame
49 50 51 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 49 def remove_ownership @frames.delete_if { |f| f.frame_id == Tos::OwnershipFrame.frame_id(@major_version, ) } end |
#remove_terms_of_use ⇒ Object
removes the terms of use frame
26 27 28 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 26 def remove_terms_of_use @frames.delete_if { |f| f.frame_id == Tos::TermsOfUseFrame.frame_id(@major_version, ) } end |
#terms_of_use ⇒ Frames::Tos::Entities::TermsOfUse?
extracts the terms of use frame (USER)
11 12 13 14 15 16 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 11 def terms_of_use frame = find_frame(Tos::TermsOfUseFrame.frame_id(@major_version, )) return nil if frame.nil? Frames::Tos::Entities::TermsOfUse.new(frame.language, frame.text) end |
#terms_of_use=(tou) ⇒ Object
sets the terms of use frame (USER)
21 22 23 |
# File 'lib/id3taginator/frames/tos_frames.rb', line 21 def terms_of_use=(tou) set_frame_fields(Tos::TermsOfUseFrame, i[@language @text], tou.language, tou.text) end |