Class: EhbrsRubyUtils::Music::LyricsBook::Song
- Inherits:
-
Resource
- Object
- Resource
- EhbrsRubyUtils::Music::LyricsBook::Song
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
#album ⇒ Object
15
16
17
|
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 15
def album
parent
end
|
#cached_lyrics ⇒ Object
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
|
36
37
38
|
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 36
def
"#{number} - #{title}"
end
|
#lyrics ⇒ Object
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
28
29
30
|
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 28
def lyrics_cached?
lyrics_cache.stored?
end
|
#valid? ⇒ Boolean
24
25
26
|
# File 'lib/ehbrs_ruby_utils/music/lyrics_book/song.rb', line 24
def valid?
tag.present?
end
|