Class: Ehbrs::Music::Album

Inherits:
Object show all
Includes:
Comparable
Defined in:
lib/ehbrs/music/album.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



13
14
15
# File 'lib/ehbrs/music/album.rb', line 13

def <=>(other)
  to_a <=> other.to_a
end

#artistObject



35
36
37
# File 'lib/ehbrs/music/album.rb', line 35

def artist
  path.parent.basename.to_s
end

#categoryObject



39
40
41
# File 'lib/ehbrs/music/album.rb', line 39

def category
  path.parent.parent.basename.to_s
end

#idObject



27
28
29
# File 'lib/ehbrs/music/album.rb', line 27

def id
  [artist, name].join('_').variableize
end

#nameObject



31
32
33
# File 'lib/ehbrs/music/album.rb', line 31

def name
  path.basename.to_s
end

#to_aObject



17
18
19
# File 'lib/ehbrs/music/album.rb', line 17

def to_a
  [category, artist, name]
end

#to_labelObject



21
22
23
# File 'lib/ehbrs/music/album.rb', line 21

def to_label
  (to_a + [id]).map(&:light_white).join(' | '.blue)
end