fb_graph 0.1.3 → 0.2.0

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.
data/README.rdoc CHANGED
@@ -146,6 +146,20 @@ Almost all connections for each object are also supported. (Private message co
146
146
  :message => 'Hello, where is photo?'
147
147
  )
148
148
 
149
+ ==== Delete an object
150
+
151
+ post = FbGraph::Page.new(117513961602338).feed.first
152
+ bool = post.like!(
153
+ :access_token => ACCESS_TOKEN
154
+ )
155
+ comment = post.comment!(
156
+ :access_token => ACCESS_TOKEN,
157
+ :message => 'Hey, I\'m testing you!'
158
+ )
159
+ comment.destroy(:access_token => ACCESS_TOKEN)
160
+ post.unlike!(:access_token => ACCESS_TOKEN)
161
+ post.destroy(:access_token => ACCESS_TOKEN)
162
+
149
163
  == Note on Patches/Pull Requests
150
164
 
151
165
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.2.0
data/fb_graph.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fb_graph}
8
- s.version = "0.1.3"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["nov matake"]
@@ -26,6 +26,10 @@ module FbGraph
26
26
  def like!(options = {})
27
27
  post(options.merge(:connection => 'likes'))
28
28
  end
29
+
30
+ def unlike!(options = {})
31
+ destroy(options.merge(:connection => 'likes'))
32
+ end
29
33
  end
30
34
  end
31
35
  end
data/lib/fb_graph/node.rb CHANGED
@@ -22,7 +22,7 @@ module FbGraph
22
22
 
23
23
  def destroy(options = {})
24
24
  options[:access_token] ||= self.access_token if self.access_token
25
- destory(self.identifier, options)
25
+ delete(options)
26
26
  end
27
27
 
28
28
  protected
@@ -44,7 +44,10 @@ module FbGraph
44
44
  def delete(params = {})
45
45
  _endpoint_ = build_endpoint(params.merge!(:method => :delete))
46
46
  handle_response do
47
- RestClient.delete(_endpoint_, params)
47
+ # NOTE:
48
+ # DELETE method didn't work for some reason.
49
+ # Use POST with "method=delete" for now.
50
+ RestClient.post(_endpoint_, params.merge!(:method => :delete))
48
51
  end
49
52
  end
50
53
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 3
9
- version: 0.1.3
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - nov matake