Class: Ehbrs::Music::Album
- Includes:
- Comparable
- Defined in:
- lib/ehbrs/music/album.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #artist ⇒ Object
- #category ⇒ Object
- #id ⇒ Object
- #name ⇒ Object
- #to_a ⇒ Object
- #to_label ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
13 14 15 |
# File 'lib/ehbrs/music/album.rb', line 13 def <=>(other) to_a <=> other.to_a end |
#artist ⇒ Object
35 36 37 |
# File 'lib/ehbrs/music/album.rb', line 35 def artist path.parent.basename.to_s end |
#category ⇒ Object
39 40 41 |
# File 'lib/ehbrs/music/album.rb', line 39 def category path.parent.parent.basename.to_s end |
#id ⇒ Object
27 28 29 |
# File 'lib/ehbrs/music/album.rb', line 27 def id [artist, name].join('_').variableize end |
#name ⇒ Object
31 32 33 |
# File 'lib/ehbrs/music/album.rb', line 31 def name path.basename.to_s end |
#to_a ⇒ Object
17 18 19 |
# File 'lib/ehbrs/music/album.rb', line 17 def to_a [category, artist, name] end |
#to_label ⇒ Object
21 22 23 |
# File 'lib/ehbrs/music/album.rb', line 21 def to_label (to_a + [id]).map(&:light_white).join(' | '.blue) end |