grooveshark 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grooveshark/playlist.rb +8 -7
- data/lib/grooveshark/version.rb +1 -1
- data/spec/grooveshark/playlist_spec.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c843eab31ff57bc1d3054c4fd0f5b5187da7b5aa
|
4
|
+
data.tar.gz: 19560cda396fec78d7de1c47d2bf2b9810dd2563
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f30ff12934dfea5802862ed51d3d984cf4d6f3e7cfd097dc980188c467f1e31581e6575a65549634574ce1668615132c1940f346da855dd6b291904134d49c4
|
7
|
+
data.tar.gz: ab02c7a541c0310065e5c2717db85f2b91db94b0cfd1145524b03f1c4419161681d5eeb17bb174ece1212fc519bed86168d58e6d8144bbf7e9fa1413ae269272
|
data/lib/grooveshark/playlist.rb
CHANGED
@@ -4,19 +4,20 @@ module Grooveshark
|
|
4
4
|
class Playlist
|
5
5
|
attr_reader :id, :user_id
|
6
6
|
attr_reader :name, :about, :picture, :username
|
7
|
-
attr_reader :songs
|
7
|
+
attr_reader :songs, :num_songs
|
8
8
|
|
9
9
|
def initialize(client, data = nil, user_id = nil)
|
10
10
|
@client = client
|
11
11
|
@songs = []
|
12
12
|
|
13
13
|
return if data.nil?
|
14
|
-
@id
|
15
|
-
@name
|
16
|
-
@about
|
17
|
-
@picture
|
18
|
-
@user_id
|
19
|
-
@username
|
14
|
+
@id = data['playlist_id']
|
15
|
+
@name = data['name']
|
16
|
+
@about = data['about']
|
17
|
+
@picture = data['picture']
|
18
|
+
@user_id = data['user_id'] || user_id
|
19
|
+
@username = data['f_name']
|
20
|
+
@num_songs = data['num_songs'].to_i
|
20
21
|
end
|
21
22
|
|
22
23
|
# Fetch playlist songs
|
data/lib/grooveshark/version.rb
CHANGED
@@ -15,13 +15,15 @@ describe 'Playlist' do
|
|
15
15
|
'about' => 'me',
|
16
16
|
'picture' => 'ruby.jpg',
|
17
17
|
'user_id' => '2',
|
18
|
-
'
|
18
|
+
'f_name' => 'PierreRambaud',
|
19
|
+
'num_songs' => '50')
|
19
20
|
expect(playlist.id).to eq('1')
|
20
21
|
expect(playlist.name).to eq('something')
|
21
22
|
expect(playlist.about).to eq('me')
|
22
23
|
expect(playlist.picture).to eq('ruby.jpg')
|
23
24
|
expect(playlist.user_id).to eq('2')
|
24
25
|
expect(playlist.username).to eq('PierreRambaud')
|
26
|
+
expect(playlist.num_songs).to eq(50)
|
25
27
|
end
|
26
28
|
|
27
29
|
it 'should initiliaze without data and user_id' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grooveshark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|