Class: EhbrsRubyUtils::Music::LyricsBook::Song

Inherits:
Resource
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/music/lyrics_book/song.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

#albumObject



15
16
17
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 15

def album
  parent
end

#cached_lyricsObject



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

def cached_lyrics
  ::YAML.load_file(lyrics_cache.content_path)
end

#header_titleObject



36
37
38
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 36

def header_title
  "#{number} - #{title}"
end

#lyricsObject



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

def lyrics
  fetch_lyrics unless lyrics_cached?
  cached_lyrics
end

#lyrics_cached?Boolean

Returns:

  • (Boolean)


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

def lyrics_cached?
  lyrics_cache.stored?
end

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  tag.present?
end