smartfm 1.0.1 → 1.0.2

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.
@@ -1,7 +1,7 @@
1
1
  module Smartfm::Version
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- REVISION = 1
4
+ REVISION = 2
5
5
  class << self
6
6
  def to_version
7
7
  "#{MAJOR}.#{MINOR}.#{REVISION}"
@@ -72,7 +72,8 @@ class Smartfm::List < Smartfm::Base
72
72
  end
73
73
 
74
74
  def add_item(auth, item)
75
- self.rest_client.add_item(auth, {:id => self.id, :item_id => item.id})
75
+ # id is used for item_id only here..
76
+ self.rest_client.add_item(auth, {:list_id => self.id, :id => item.id})
76
77
  end
77
78
 
78
79
  def delete_item(auth, item)
@@ -18,15 +18,7 @@ module Smartfm::PrivateContent
18
18
 
19
19
  module InstanceMethods
20
20
  def save(auth)
21
- result = self.rest_client.create(auth, self.to_post_data)
22
- case result
23
- when Hash
24
- self.deserialize(result)
25
- when String
26
- self.find(result)
27
- else
28
- true
29
- end
21
+ self.rest_client.create(auth, self.to_post_data)
30
22
  end
31
23
  end
32
24
 
@@ -11,8 +11,8 @@ module Smartfm::PublicContent
11
11
  self.deserialize(hash) || []
12
12
  end
13
13
 
14
- def find(list_id, params = {})
15
- params[:id] = list_id
14
+ def find(obj_id, params = {})
15
+ params[:id] = obj_id
16
16
  hash = self.rest_client.find(params)
17
17
  self.deserialize(hash)
18
18
  end
@@ -39,7 +39,7 @@ module Smartfm::PublicContent
39
39
  when Hash
40
40
  self.deserialize(result)
41
41
  when String
42
- self.find(result)
42
+ self.class.find(result)
43
43
  else
44
44
  true
45
45
  end
@@ -8,7 +8,7 @@ class Smartfm::RestClient::List < Smartfm::RestClient::Base
8
8
  :matching => {:path => '/lists/matching/__keyword__'},
9
9
  :likes => {:path => '/lists/__id__/likes' },
10
10
  :create => {:path => '/lists', :http_method => :post},
11
- :add_item => {:path => '/lists/__id__/items', :http_method => :post},
11
+ :add_item => {:path => '/lists/__list_id__/items', :http_method => :post}, # id is used for item_id here..
12
12
  :like! => {:path => '/lists/__id__/likes', :http_method => :post},
13
13
  :delete => {:path => '/lists/__id__', :http_method => :delete},
14
14
  :delete_item => {:path => '/lists/__id__/items/__item_id__', :http_method => :delete},
@@ -13,8 +13,8 @@ class Smartfm::RestClient::User < Smartfm::RestClient::Base
13
13
  :notifications => {:path => '/users/__username__/notifications'},
14
14
  :matching => {:path => '/users/matching/__keyword__' },
15
15
  :study_results => {:path => '/users/__username__/study_results/__application__'},
16
- :follow! => {:path => '/users/__username__/friends', :http_method => :post},
17
- :unfollow! => {:path => '/users/__username__/friends', :http_method => :delete}
16
+ :follow! => {:path => '/friends', :http_method => :post},
17
+ :unfollow! => {:path => '/friends/__username__', :http_method => :delete}
18
18
  }
19
19
 
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov