Class: EhbrsRubyUtils::Music::LyricsBook::Album

Inherits:
Resource
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/music/lyrics_book/album.rb

Instance Attribute Summary

Attributes inherited from Resource

#previous

Instance Method Summary collapse

Methods inherited from Resource

#<=>, create_list, #filename, #header_id, #header_index, #index_id, #link_to_header, #output_index, #output_main, #type

Instance Method Details

#artistObject



28
29
30
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/album.rb', line 28

def artist
  from_songs_tag(:artist)
end

#bookObject



12
13
14
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/album.rb', line 12

def book
  parent
end

#first_previousObject



16
17
18
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/album.rb', line 16

def first_previous
  previous.if_present { |v| v.songs.last }
end

#header_titleObject



24
25
26
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/album.rb', line 24

def header_title
  "#{songs.first.number}-#{songs.last.number} | #{artist} | #{title}"
end

#titleObject



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

def title
  from_songs_tag(:album)
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/album.rb', line 20

def valid?
  songs.any?
end