Class: Ejaydj::Dj
Direct Known Subclasses
Constant Summary collapse
- PLAYLIST_SCHEDULE =
{ 600..1159 => :morning_playlists, # 6AM - 12PM 1200..1759 => :noon_playlists, # 12PM - 5:59PM 1800..2259 => :night_playlists, # 6PM - 10:59PM 2300..2359 => :late_night_playlists, # 11PM - 11:59AM 0..559 => :late_night_playlists # 12AM - 5:59AM }
Instance Attribute Summary collapse
-
#late_night_playlists ⇒ Object
Returns the value of attribute late_night_playlists.
-
#morning_playlists ⇒ Object
Returns the value of attribute morning_playlists.
-
#music_client ⇒ Object
writeonly
Sets the attribute music_client.
-
#music_client_id ⇒ Object
Returns the value of attribute music_client_id.
-
#music_client_secret ⇒ Object
Returns the value of attribute music_client_secret.
-
#music_user_id ⇒ Object
Returns the value of attribute music_user_id.
-
#night_playlists ⇒ Object
Returns the value of attribute night_playlists.
-
#noon_playlists ⇒ Object
Returns the value of attribute noon_playlists.
Instance Method Summary collapse
-
#initialize(attributes = {}) {|_self| ... } ⇒ Dj
constructor
A new instance of Dj.
- #play_me_a_song(time: Time.now) ⇒ Object
- #playlists ⇒ Object
- #reload! ⇒ Object
Constructor Details
#initialize(attributes = {}) {|_self| ... } ⇒ Dj
Returns a new instance of Dj.
26 27 28 29 |
# File 'lib/ejaydj/dj.rb', line 26 def initialize(attributes={}) instantiate_variables_from attributes yield self if block_given? end |
Instance Attribute Details
#late_night_playlists ⇒ Object
Returns the value of attribute late_night_playlists.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def late_night_playlists @late_night_playlists end |
#morning_playlists ⇒ Object
Returns the value of attribute morning_playlists.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def morning_playlists @morning_playlists end |
#music_client=(value) ⇒ Object
Sets the attribute music_client
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def music_client=(value) @music_client = value end |
#music_client_id ⇒ Object
Returns the value of attribute music_client_id.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def music_client_id @music_client_id end |
#music_client_secret ⇒ Object
Returns the value of attribute music_client_secret.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def music_client_secret @music_client_secret end |
#music_user_id ⇒ Object
Returns the value of attribute music_user_id.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def music_user_id @music_user_id end |
#night_playlists ⇒ Object
Returns the value of attribute night_playlists.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def night_playlists @night_playlists end |
#noon_playlists ⇒ Object
Returns the value of attribute noon_playlists.
17 18 19 |
# File 'lib/ejaydj/dj.rb', line 17 def noon_playlists @noon_playlists end |
Instance Method Details
#play_me_a_song(time: Time.now) ⇒ Object
31 32 33 |
# File 'lib/ejaydj/dj.rb', line 31 def play_me_a_song(time: Time.now) current_playlist(time).next_track end |
#playlists ⇒ Object
35 36 37 |
# File 'lib/ejaydj/dj.rb', line 35 def playlists @playlists ||= all_playlists end |
#reload! ⇒ Object
39 40 41 42 |
# File 'lib/ejaydj/dj.rb', line 39 def reload! @playlists = all_playlists @playlists.each(&:reload!) end |