Class: EhbrsRubyUtils::Music::Ous::Album

Inherits:
Node
  • Object
show all
Includes:
Comparable
Defined in:
lib/ehbrs_ruby_utils/music/ous/album.rb

Constant Summary

Constants inherited from Node

Node::DEFAULT_LANGUAGE, Node::LANGUAGE_FILE_BASENAME

Instance Method Summary collapse

Methods inherited from Node

#language, #language_file, #name, #parent_language, #real_path, #self_language, #to_s

Instance Method Details

#<=>(other) ⇒ Object



9
10
11
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 9

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

#artistEhbrsRubyUtils::Music::Ous::Artist



32
33
34
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 32

def artist
  parent_node
end

#categoryObject



36
37
38
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 36

def category
  artist.parent_node
end

#idObject



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

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

#parent_node_classObject



40
41
42
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 40

def parent_node_class
  ::EhbrsRubyUtils::Music::Ous::Artist
end

#to_aObject



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

def to_a
  [language, category.name, artist.name, name]
end

#to_circular_list_spreader_pathObject



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

def to_circular_list_spreader_path
  to_a
end

#to_labelObject



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

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