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



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

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

#artistEhbrsRubyUtils::Music::Ous::Artist



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

def artist
  parent_node
end

#categoryObject



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

def category
  artist.parent_node
end

#idObject



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

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

#parent_node_classObject



44
45
46
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 44

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

#to_aObject



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

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

#to_circular_list_spreader_pathObject



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

def to_circular_list_spreader_path
  to_a
end

#to_labelObject



25
26
27
# File 'lib/ehbrs_ruby_utils/music/ous/album.rb', line 25

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