Class: MusicBlender::Id3Adapter
- Inherits:
-
Object
- Object
- MusicBlender::Id3Adapter
- Defined in:
- lib/music_blender/id3_adapter.rb
Constant Summary collapse
- RATING_FRAME_DESCRIPTION =
'MMP Rating'
Instance Attribute Summary collapse
-
#initial_rating ⇒ Object
readonly
Returns the value of attribute initial_rating.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #artist ⇒ Object
-
#initialize(path, initial_rating) ⇒ Id3Adapter
constructor
A new instance of Id3Adapter.
- #rating ⇒ Object
- #set_rating(value) ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(path, initial_rating) ⇒ Id3Adapter
Returns a new instance of Id3Adapter.
6 7 8 9 |
# File 'lib/music_blender/id3_adapter.rb', line 6 def initialize(path,) @path = path @initial_rating = end |
Instance Attribute Details
#initial_rating ⇒ Object (readonly)
Returns the value of attribute initial_rating.
4 5 6 |
# File 'lib/music_blender/id3_adapter.rb', line 4 def @initial_rating end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/music_blender/id3_adapter.rb', line 4 def path @path end |
Instance Method Details
#artist ⇒ Object
15 16 17 |
# File 'lib/music_blender/id3_adapter.rb', line 15 def artist v2tag.artist || v1tag.artist end |
#rating ⇒ Object
19 20 21 |
# File 'lib/music_blender/id3_adapter.rb', line 19 def .text.to_i end |
#set_rating(value) ⇒ Object
23 24 25 26 |
# File 'lib/music_blender/id3_adapter.rb', line 23 def (value) .text = value.to_s tag_file.save end |
#title ⇒ Object
11 12 13 |
# File 'lib/music_blender/id3_adapter.rb', line 11 def title v2tag.title || v1tag.title end |