Class: MonkeyMusic::Generate::ToplistLoader
- Inherits:
-
Object
- Object
- MonkeyMusic::Generate::ToplistLoader
- Defined in:
- lib/monkey_music_generate/toplist_loader.rb
Instance Attribute Summary collapse
-
#loaded_toplists ⇒ Object
readonly
Returns the value of attribute loaded_toplists.
Instance Method Summary collapse
-
#initialize(toplist_file) ⇒ ToplistLoader
constructor
A new instance of ToplistLoader.
- #load_for_user!(user) ⇒ Object
Constructor Details
#initialize(toplist_file) ⇒ ToplistLoader
Returns a new instance of ToplistLoader.
7 8 9 10 11 |
# File 'lib/monkey_music_generate/toplist_loader.rb', line 7 def initialize(toplist_file) @toplist_file = toplist_file @toplists = {} @loaded_toplists = {} end |
Instance Attribute Details
#loaded_toplists ⇒ Object (readonly)
Returns the value of attribute loaded_toplists.
5 6 7 |
# File 'lib/monkey_music_generate/toplist_loader.rb', line 5 def loaded_toplists @loaded_toplists end |
Instance Method Details
#load_for_user!(user) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/monkey_music_generate/toplist_loader.rb', line 13 def load_for_user!(user) @user = user # Load toplists URI:s from file self.instance_eval(IO.read @toplist_file) # Load toplist contents from libspotify load_toplists! end |