-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalbum_init.rb
44 lines (39 loc) · 920 Bytes
/
album_init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'rubygems'
module Genre
POP, CLASSIC, JAZZ, ROCK = *1..4
end
class Track
attr_accessor :name, :location, :view, :seconds
def initialize (name, location, view, seconds)
@name = name
@location = location
@view = view
@seconds = seconds
end
end
class Playlist_Track
attr_accessor :name, :location, :org_album_number, :org_track_number, :seconds
def initialize (name, location, org_album_number, org_track_number, seconds)
@name = name
@location = location
@org_album_number = org_album_number
@org_track_number = org_track_number
@seconds = seconds
end
end
class Album
attr_accessor :artist, :title, :year, :genre, :artwork, :tracks
def initialize (artist, title, year, genre, artwork, tracks)
@artist = artist
@title = title
@year = year
@genre = genre
@artwork = artwork
@tracks = tracks
end
end
class Array
def shuffle
sort_by { rand }
end
end