fb_graph 1.8.0 → 1.8.1

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.
Files changed (65) hide show
  1. data/Gemfile.lock +1 -1
  2. data/VERSION +1 -1
  3. data/lib/fb_graph/album.rb +2 -2
  4. data/lib/fb_graph/app_request.rb +3 -3
  5. data/lib/fb_graph/checkin.rb +5 -5
  6. data/lib/fb_graph/comment.rb +2 -2
  7. data/lib/fb_graph/connections/accounts.rb +1 -1
  8. data/lib/fb_graph/connections/activities.rb +1 -1
  9. data/lib/fb_graph/connections/albums.rb +2 -2
  10. data/lib/fb_graph/connections/app_requests.rb +1 -1
  11. data/lib/fb_graph/connections/attending.rb +1 -1
  12. data/lib/fb_graph/connections/books.rb +1 -1
  13. data/lib/fb_graph/connections/checkins.rb +2 -2
  14. data/lib/fb_graph/connections/comments.rb +2 -2
  15. data/lib/fb_graph/connections/declined.rb +1 -1
  16. data/lib/fb_graph/connections/events.rb +2 -2
  17. data/lib/fb_graph/connections/family.rb +1 -1
  18. data/lib/fb_graph/connections/feed.rb +2 -2
  19. data/lib/fb_graph/connections/former_participants.rb +1 -1
  20. data/lib/fb_graph/connections/friend_lists.rb +1 -1
  21. data/lib/fb_graph/connections/friends.rb +1 -1
  22. data/lib/fb_graph/connections/games.rb +1 -1
  23. data/lib/fb_graph/connections/groups.rb +1 -1
  24. data/lib/fb_graph/connections/home.rb +1 -1
  25. data/lib/fb_graph/connections/insights.rb +1 -1
  26. data/lib/fb_graph/connections/interests.rb +1 -1
  27. data/lib/fb_graph/connections/invited.rb +1 -1
  28. data/lib/fb_graph/connections/likes.rb +2 -3
  29. data/lib/fb_graph/connections/links.rb +2 -2
  30. data/lib/fb_graph/connections/maybe.rb +1 -1
  31. data/lib/fb_graph/connections/members.rb +1 -1
  32. data/lib/fb_graph/connections/messages.rb +1 -1
  33. data/lib/fb_graph/connections/movies.rb +1 -1
  34. data/lib/fb_graph/connections/music.rb +1 -1
  35. data/lib/fb_graph/connections/noreply.rb +1 -1
  36. data/lib/fb_graph/connections/notes.rb +2 -2
  37. data/lib/fb_graph/connections/participants.rb +1 -1
  38. data/lib/fb_graph/connections/payments.rb +1 -1
  39. data/lib/fb_graph/connections/photos.rb +2 -2
  40. data/lib/fb_graph/connections/posts.rb +1 -1
  41. data/lib/fb_graph/connections/senders.rb +1 -1
  42. data/lib/fb_graph/connections/statuses.rb +1 -1
  43. data/lib/fb_graph/connections/tagged.rb +1 -1
  44. data/lib/fb_graph/connections/television.rb +1 -1
  45. data/lib/fb_graph/connections/test_users.rb +2 -2
  46. data/lib/fb_graph/connections/threads.rb +1 -1
  47. data/lib/fb_graph/connections/videos.rb +1 -1
  48. data/lib/fb_graph/education.rb +5 -5
  49. data/lib/fb_graph/event.rb +1 -1
  50. data/lib/fb_graph/group.rb +1 -1
  51. data/lib/fb_graph/klass.rb +1 -1
  52. data/lib/fb_graph/link.rb +2 -2
  53. data/lib/fb_graph/message.rb +2 -2
  54. data/lib/fb_graph/node.rb +1 -1
  55. data/lib/fb_graph/note.rb +2 -2
  56. data/lib/fb_graph/order.rb +3 -3
  57. data/lib/fb_graph/photo.rb +2 -2
  58. data/lib/fb_graph/post.rb +7 -7
  59. data/lib/fb_graph/searchable.rb +1 -1
  60. data/lib/fb_graph/status.rb +3 -3
  61. data/lib/fb_graph/tag.rb +6 -6
  62. data/lib/fb_graph/user.rb +8 -8
  63. data/lib/fb_graph/video.rb +2 -2
  64. data/lib/fb_graph/work.rb +5 -5
  65. metadata +2 -2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fb_graph (1.8.0.alpha)
4
+ fb_graph (1.8.0)
5
5
  httpclient (>= 2.2.0.2)
6
6
  rack-oauth2 (>= 0.6.9)
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.8.1
@@ -11,9 +11,9 @@ module FbGraph
11
11
  super
12
12
  @from = if (from = attributes[:from])
13
13
  if from[:category]
14
- Page.new(from.delete(:id), from)
14
+ Page.new(from[:id], from)
15
15
  else
16
- User.new(from.delete(:id), from)
16
+ User.new(from[:id], from)
17
17
  end
18
18
  end
19
19
  @name = attributes[:name]
@@ -8,13 +8,13 @@ module FbGraph
8
8
  @data = attributes[:data]
9
9
  @message = attributes[:message]
10
10
  if attributes[:from]
11
- @from = User.new(attributes[:from].delete(:id), attributes[:from])
11
+ @from = User.new(attributes[:from][:id], attributes[:from])
12
12
  end
13
13
  if attributes[:to]
14
- @to = User.new(attributes[:to].delete(:id), attributes[:to])
14
+ @to = User.new(attributes[:to][:id], attributes[:to])
15
15
  end
16
16
  if attributes[:application]
17
- @application = Application.new(attributes[:application].delete(:id), attributes[:application])
17
+ @application = Application.new(attributes[:application][:id], attributes[:application])
18
18
  end
19
19
  if attributes[:created_time]
20
20
  @created_time = Time.parse(attributes[:created_time]).utc
@@ -7,12 +7,12 @@ module FbGraph
7
7
  def initialize(identifier, attributes = {})
8
8
  super
9
9
  if (from = attributes[:from])
10
- @from = User.new(from.delete(:id), from)
10
+ @from = User.new(from[:id], from)
11
11
  end
12
12
  @tags = []
13
13
  if (tags = attributes[:tags])
14
14
  Collection.new(tags).each do |user|
15
- @tags << User.new(user.delete(:id), user)
15
+ @tags << User.new(user[:id], user)
16
16
  end
17
17
  end
18
18
  if (place = attributes[:place])
@@ -22,14 +22,14 @@ module FbGraph
22
22
  when String, Integer
23
23
  Place.new(place)
24
24
  when Hash
25
- Place.new(place.delete(:id), place)
25
+ Place.new(place[:id], place)
26
26
  end
27
27
  end
28
28
  @message = attributes[:message]
29
29
  if (application = attributes[:application])
30
- @application = Application.new(application.delete(:id), application)
30
+ @application = Application.new(application[:id], application)
31
31
  end
32
- if (created_time = attributes.delete(:created_time))
32
+ if (created_time = attributes[:created_time])
33
33
  @created_time = Time.parse(created_time).utc
34
34
  end
35
35
  end
@@ -8,9 +8,9 @@ module FbGraph
8
8
  super
9
9
  if (from = attributes[:from])
10
10
  @from = if from[:category]
11
- Page.new(from.delete(:id), from)
11
+ Page.new(from[:id], from)
12
12
  else
13
- User.new(from.delete(:id), from)
13
+ User.new(from[:id], from)
14
14
  end
15
15
  end
16
16
  @message = attributes[:message]
@@ -5,7 +5,7 @@ module FbGraph
5
5
  accounts = self.connection(:accounts, options)
6
6
  accounts.map! do |account|
7
7
  account[:access_token] ||= options[:access_token] || self.access_token
8
- Page.new(account.delete(:id), account)
8
+ Page.new(account[:id], account)
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def activities(options = {})
5
5
  activities = self.connection(:activities, options)
6
6
  activities.map! do |activity|
7
- Page.new(activity.delete(:id), activity.merge(
7
+ Page.new(activity[:id], activity.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def albums(options = {})
5
5
  albums = self.connection(:albums, options)
6
6
  albums.map! do |album|
7
- Album.new(album.delete(:id), album.merge(
7
+ Album.new(album[:id], album.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def album!(options = {})
14
14
  album = post(options.merge(:connection => :albums))
15
- Album.new(album.delete(:id), options.merge(album).merge(
15
+ Album.new(album[:id], options.merge(album).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def app_requests(options = {})
5
5
  app_requests = self.connection(:apprequests, options)
6
6
  app_requests.map! do |app_request|
7
- AppRequest.new(app_request.delete(:id), app_request.merge(
7
+ AppRequest.new(app_request[:id], app_request.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def attending(options = {})
5
5
  members = self.connection(:attending, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def books(options = {})
5
5
  books = self.connection(:books, options)
6
6
  books.map! do |book|
7
- Page.new(book.delete(:id), book.merge(
7
+ Page.new(book[:id], book.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def checkins(options = {})
5
5
  checkins = self.connection(:checkins, options)
6
6
  checkins.map! do |checkin|
7
- Checkin.new(checkin.delete(:id), checkin.merge(
7
+ Checkin.new(checkin[:id], checkin.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def checkin!(options = {})
14
14
  checkin = post(options.merge(:connection => :checkins))
15
- Checkin.new(checkin.delete(:id), options.merge(checkin).merge(
15
+ Checkin.new(checkin[:id], options.merge(checkin).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -8,7 +8,7 @@ module FbGraph
8
8
  self.connection(:comments, options)
9
9
  end
10
10
  comments.map! do |comment|
11
- Comment.new(comment.delete(:id), comment.merge(
11
+ Comment.new(comment[:id], comment.merge(
12
12
  :access_token => options[:access_token] || self.access_token
13
13
  ))
14
14
  end
@@ -16,7 +16,7 @@ module FbGraph
16
16
 
17
17
  def comment!(options = {})
18
18
  comment = post(options.merge(:connection => :comments))
19
- Comment.new(comment.delete(:id), options.merge(comment).merge(
19
+ Comment.new(comment[:id], options.merge(comment).merge(
20
20
  :access_token => options[:access_token] || self.access_token
21
21
  ))
22
22
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def declined(options = {})
5
5
  members = self.connection(:declined, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def events(options = {})
5
5
  events = self.connection(:events, options)
6
6
  events.map! do |event|
7
- Event.new(event.delete(:id), event.merge(
7
+ Event.new(event[:id], event.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def event!(options = {})
14
14
  event = post(options.merge(:connection => :events))
15
- Event.new(event.delete(:id), options.merge(event).merge(
15
+ Event.new(event[:id], options.merge(event).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def family(options = {})
5
5
  users = self.connection(:family, options)
6
6
  users.map! do |user|
7
- User.new(user.delete(:id), user.merge(
7
+ User.new(user[:id], user.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def feed(options = {})
5
5
  posts = self.connection(:feed, options)
6
6
  posts.map! do |post|
7
- Post.new(post.delete(:id), post.merge(
7
+ Post.new(post[:id], post.merge(
8
8
  :context => self.class,
9
9
  :access_token => options[:access_token] || self.access_token
10
10
  ))
@@ -13,7 +13,7 @@ module FbGraph
13
13
 
14
14
  def feed!(options = {})
15
15
  post = post(options.merge(:connection => :feed))
16
- Post.new(post.delete(:id), options.merge(post).merge(
16
+ Post.new(post[:id], options.merge(post).merge(
17
17
  :access_token => options[:access_token] || self.access_token
18
18
  ))
19
19
  end
@@ -8,7 +8,7 @@ module FbGraph
8
8
  self.connection(:former_participants, options)
9
9
  end
10
10
  users.map! do |user|
11
- User.new(user.delete(:id), user.merge(
11
+ User.new(user[:id], user.merge(
12
12
  :access_token => options[:access_token] || self.access_token
13
13
  ))
14
14
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def friend_lists(options = {})
5
5
  friend_lists = self.connection(:friendlists, options)
6
6
  friend_lists.map! do |friend_list|
7
- FriendList.new(friend_list.delete(:id), friend_list.merge(
7
+ FriendList.new(friend_list[:id], friend_list.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def friends(options = {})
5
5
  users = self.connection(:friends, options)
6
6
  users.map! do |user|
7
- User.new(user.delete(:id), user.merge(
7
+ User.new(user[:id], user.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def games(options = {})
5
5
  games = self.connection(:games, options)
6
6
  games.map! do |game|
7
- Page.new(game.delete(:id), game.merge(
7
+ Page.new(game[:id], game.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def groups(options = {})
5
5
  groups = self.connection(:groups, options)
6
6
  groups.map! do |group|
7
- Group.new(group.delete(:id), group.merge(
7
+ Group.new(group[:id], group.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def home(options = {})
5
5
  posts = self.connection(:home, options)
6
6
  posts.map! do |post|
7
- Post.new(post.delete(:id), post.merge(
7
+ Post.new(post[:id], post.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -6,7 +6,7 @@ module FbGraph
6
6
  options[:access_token] ||= get_access_token(options[:secret]) if respond_to?(:get_access_token)
7
7
  insights = self.connection(:insights, options.merge(:connection_scope => connection_scope(options)))
8
8
  insights.map! do |insight|
9
- Insight.new(insight.delete(:id), insight.merge(:access_token => options[:access_token]))
9
+ Insight.new(insight[:id], insight.merge(:access_token => options[:access_token]))
10
10
  end
11
11
  end
12
12
 
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def interests(options = {})
5
5
  interests = self.connection(:interests, options)
6
6
  interests.map! do |interest|
7
- Page.new(interest.delete(:id), interest.merge(
7
+ Page.new(interest[:id], interest.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def invited(options = {})
5
5
  members = self.connection(:invited, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -8,14 +8,13 @@ module FbGraph
8
8
  self.connection(:likes, options)
9
9
  end
10
10
  likes.map! do |like|
11
- identifier = like.delete(:id)
12
11
  like.merge!(
13
12
  :access_token => options[:access_token] || self.access_token
14
13
  )
15
14
  if like[:category]
16
- Page.new(identifier, like)
15
+ Page.new(like[:id], like)
17
16
  else
18
- User.new(identifier, like)
17
+ User.new(like[:id], like)
19
18
  end
20
19
  end
21
20
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def links(options = {})
5
5
  links = self.connection(:links, options)
6
6
  links.map! do |link|
7
- Link.new(link.delete(:id), link.merge(
7
+ Link.new(link[:id], link.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def link!(options = {})
14
14
  link = post(options.merge(:connection => :links))
15
- Link.new(link.delete(:id), options.merge(link).merge(
15
+ Link.new(link[:id], options.merge(link).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def maybe(options = {})
5
5
  members = self.connection(:maybe, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def members(options = {})
5
5
  members = self.connection(:members, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -8,7 +8,7 @@ module FbGraph
8
8
  self.connection(:messages, options)
9
9
  end
10
10
  messages.map! do |message|
11
- Message.new(message.delete(:id), message.merge(
11
+ Message.new(message[:id], message.merge(
12
12
  :access_token => options[:access_token] || self.access_token
13
13
  ))
14
14
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def movies(options = {})
5
5
  movies = self.connection(:movies, options)
6
6
  movies.map! do |movie|
7
- Page.new(movie.delete(:id), movie.merge(
7
+ Page.new(movie[:id], movie.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def music(options = {})
5
5
  music = self.connection(:music, options)
6
6
  music.map! do |_music_|
7
- Page.new(_music_.delete(:id), _music_.merge(
7
+ Page.new(_music_[:id], _music_.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def noreply(options = {})
5
5
  members = self.connection(:noreply, options)
6
6
  members.map! do |member|
7
- User.new(member.delete(:id), member.merge(
7
+ User.new(member[:id], member.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def notes(options = {})
5
5
  notes = self.connection(:notes, options)
6
6
  notes.map! do |note|
7
- Note.new(note.delete(:id), note.merge(
7
+ Note.new(note[:id], note.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def note!(options = {})
14
14
  note = post(options.merge(:connection => :notes))
15
- Note.new(note.delete(:id), options.merge(note).merge(
15
+ Note.new(note[:id], options.merge(note).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -8,7 +8,7 @@ module FbGraph
8
8
  self.connection(:participants, options)
9
9
  end
10
10
  users.map! do |user|
11
- User.new(user.delete(:id), user.merge(
11
+ User.new(user[:id], user.merge(
12
12
  :access_token => options[:access_token] || self.access_token
13
13
  ))
14
14
  end
@@ -7,7 +7,7 @@ module FbGraph
7
7
  orders = self.connection(:payments, options)
8
8
  orders.map! do |order|
9
9
  orders[:access_token] ||= options[:access_token] || self.access_token
10
- Order.new(order.delete(:id), order)
10
+ Order.new(order[:id], order)
11
11
  end
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def photos(options = {})
5
5
  photos = self.connection(:photos, options)
6
6
  photos.map! do |photo|
7
- Photo.new(photo.delete(:id), photo.merge(
7
+ Photo.new(photo[:id], photo.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -12,7 +12,7 @@ module FbGraph
12
12
 
13
13
  def photo!(options = {})
14
14
  photo = post(options.merge(:connection => :photos))
15
- Photo.new(photo.delete(:id), options.merge(photo).merge(
15
+ Photo.new(photo[:id], options.merge(photo).merge(
16
16
  :access_token => options[:access_token] || self.access_token
17
17
  ))
18
18
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def posts(options = {})
5
5
  posts = self.connection(:posts, options)
6
6
  posts.map! do |post|
7
- Post.new(post.delete(:id), post.merge(
7
+ Post.new(post[:id], post.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -8,7 +8,7 @@ module FbGraph
8
8
  self.connection(:senders, options)
9
9
  end
10
10
  users.map! do |user|
11
- User.new(user.delete(:id), user.merge(
11
+ User.new(user[:id], user.merge(
12
12
  :access_token => options[:access_token] || self.access_token
13
13
  ))
14
14
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def statuses(options = {})
5
5
  statuses = self.connection(:statuses, options)
6
6
  statuses.map! do |status|
7
- Status.new(status.delete(:id), status.merge(
7
+ Status.new(status[:id], status.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def tagged(options = {})
5
5
  posts = self.connection(:tagged, options)
6
6
  posts.map! do |post|
7
- Post.new(post.delete(:id), post.merge(
7
+ Post.new(post[:id], post.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def television(options = {})
5
5
  television = self.connection(:television, options)
6
6
  television.map! do |_television_|
7
- Page.new(_television_.delete(:id), _television_.merge(
7
+ Page.new(_television_[:id], _television_.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -5,14 +5,14 @@ module FbGraph
5
5
  options[:access_token] ||= self.access_token || get_access_token(options[:secret])
6
6
  test_users = self.connection(:accounts, options.merge(:connection_scope => 'test-users'))
7
7
  test_users.map! do |test_user|
8
- TestUser.new(test_user.delete(:id), test_user)
8
+ TestUser.new(test_user[:id], test_user)
9
9
  end
10
10
  end
11
11
 
12
12
  def test_user!(options = {})
13
13
  options[:access_token] ||= self.access_token || get_access_token(options[:secret])
14
14
  test_user = post(options.merge(:connection => :accounts, :connection_scope => 'test-users'))
15
- TestUser.new(test_user.delete(:id), test_user)
15
+ TestUser.new(test_user[:id], test_user)
16
16
  end
17
17
  end
18
18
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def threads(options = {})
5
5
  threads = self.connection(:threads, options)
6
6
  threads.map! do |thread|
7
- Thread.new(thread.delete(:id), thread.merge(
7
+ Thread.new(thread[:id], thread.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -4,7 +4,7 @@ module FbGraph
4
4
  def videos(options = {})
5
5
  videos = self.connection(:videos, options)
6
6
  videos.map! do |video|
7
- Video.new(video.delete(:id), video.merge(
7
+ Video.new(video[:id], video.merge(
8
8
  :access_token => options[:access_token] || self.access_token
9
9
  ))
10
10
  end
@@ -6,24 +6,24 @@ module FbGraph
6
6
 
7
7
  def initialize(attributes = {})
8
8
  if (school = attributes[:school])
9
- @school = Page.new(school.delete(:id), school)
9
+ @school = Page.new(school[:id], school)
10
10
  end
11
11
  if (degree = attributes[:degree])
12
- @degree = Page.new(degree.delete(:id), degree)
12
+ @degree = Page.new(degree[:id], degree)
13
13
  end
14
14
  if (year = attributes[:year])
15
- @year = Page.new(year.delete(:id), year)
15
+ @year = Page.new(year[:id], year)
16
16
  end
17
17
  @concentration = []
18
18
  if attributes[:concentration]
19
19
  attributes[:concentration].each do |concentration|
20
- @concentration << Page.new(concentration.delete(:id), concentration)
20
+ @concentration << Page.new(concentration[:id], concentration)
21
21
  end
22
22
  end
23
23
  @classes = []
24
24
  if attributes[:classes]
25
25
  attributes[:classes].each do |klass|
26
- @classes << Klass.new(klass.delete(:id), klass)
26
+ @classes << Klass.new(klass[:id], klass)
27
27
  end
28
28
  end
29
29
  @type = attributes[:type]
@@ -14,7 +14,7 @@ module FbGraph
14
14
  def initialize(identifier, attributes = {})
15
15
  super
16
16
  if (owner = attributes[:owner])
17
- @owner = User.new(owner.delete(:id), owner)
17
+ @owner = User.new(owner[:id], owner)
18
18
  end
19
19
  @name = attributes[:name]
20
20
  @description = attributes[:description]
@@ -10,7 +10,7 @@ module FbGraph
10
10
  def initialize(identifier, attributes = {})
11
11
  super
12
12
  if (owner = attributes[:owner])
13
- @owner = User.new(owner.delete(:id), owner)
13
+ @owner = User.new(owner[:id], owner)
14
14
  end
15
15
  @name = attributes[:name]
16
16
  @description = attributes[:description]
@@ -7,7 +7,7 @@ module FbGraph
7
7
  @with = []
8
8
  if attributes[:with]
9
9
  attributes[:with].each do |user|
10
- @with << User.new(user.delete(:id), user)
10
+ @with << User.new(user[:id], user)
11
11
  end
12
12
  end
13
13
  if attributes[:start_date]
data/lib/fb_graph/link.rb CHANGED
@@ -9,9 +9,9 @@ module FbGraph
9
9
  super
10
10
  if (from = attributes[:from])
11
11
  @from = if from[:category]
12
- Page.new(from.delete(:id), from)
12
+ Page.new(from[:id], from)
13
13
  else
14
- User.new(from.delete(:id), from)
14
+ User.new(from[:id], from)
15
15
  end
16
16
  end
17
17
  @name = attributes[:name]
@@ -11,12 +11,12 @@ module FbGraph
11
11
  @subject = attributes[:subject]
12
12
  @message = attributes[:message]
13
13
  if (from = attributes[:from])
14
- @from = User.new(from.delete(:id), from)
14
+ @from = User.new(from[:id], from)
15
15
  end
16
16
  @to = []
17
17
  if attributes[:to]
18
18
  Collection.new(attributes[:to]).each do |to|
19
- @to << User.new(to.delete(:id), to)
19
+ @to << User.new(to[:id], to)
20
20
  end
21
21
  end
22
22
  @tags = []
data/lib/fb_graph/node.rb CHANGED
@@ -13,7 +13,7 @@ module FbGraph
13
13
  def fetch(options = {})
14
14
  options[:access_token] ||= self.access_token if self.access_token
15
15
  _fetched_ = get(options)
16
- self.class.new(_fetched_.delete(:id), _fetched_.merge(:access_token => options[:access_token]))
16
+ self.class.new(_fetched_[:id], _fetched_.merge(:access_token => options[:access_token]))
17
17
  end
18
18
 
19
19
  def self.fetch(identifier, options = {})
data/lib/fb_graph/note.rb CHANGED
@@ -9,9 +9,9 @@ module FbGraph
9
9
  super
10
10
  if (from = attributes[:from])
11
11
  @from = if from[:category]
12
- Page.new(from.delete(:id), from)
12
+ Page.new(from[:id], from)
13
13
  else
14
- User.new(from.delete(:id), from)
14
+ User.new(from[:id], from)
15
15
  end
16
16
  end
17
17
  @subject = attributes[:subject]
@@ -5,13 +5,13 @@ module FbGraph
5
5
  def initialize(identifier, attributes = {})
6
6
  super
7
7
  if application = attributes[:application]
8
- @application = Application.new(app.delete(:id), app)
8
+ @application = Application.new(app[:id], app)
9
9
  end
10
10
  if from = attributes[:from]
11
- @from = User.new(from.delete(:id), from)
11
+ @from = User.new(from[:id], from)
12
12
  end
13
13
  if to = attributes[:to]
14
- @to = User.new(to.delete(:id), to)
14
+ @to = User.new(to[:id], to)
15
15
  end
16
16
  @status = attributes[:status]
17
17
  @country = attributes[:country]
@@ -9,9 +9,9 @@ module FbGraph
9
9
  super
10
10
  if (from = attributes[:from])
11
11
  @from = if from[:category]
12
- Page.new(from.delete(:id), from)
12
+ Page.new(from[:id], from)
13
13
  else
14
- User.new(from.delete(:id), from)
14
+ User.new(from[:id], from)
15
15
  end
16
16
  end
17
17
  @tags = []
data/lib/fb_graph/post.rb CHANGED
@@ -10,25 +10,25 @@ module FbGraph
10
10
  super
11
11
  if (from = attributes[:from])
12
12
  @from = if from[:category]
13
- Page.new(from.delete(:id), from)
13
+ Page.new(from[:id], from)
14
14
  else
15
- User.new(from.delete(:id), from)
15
+ User.new(from[:id], from)
16
16
  end
17
17
  end
18
18
  @to = []
19
19
  if attributes[:to]
20
20
  Collection.new(attributes[:to]).each do |to|
21
21
  @to << if to[:category]
22
- Page.new(to.delete(:id), to)
22
+ Page.new(to[:id], to)
23
23
  elsif to[:start_time]
24
- Event.new(to.delete(:id), to)
24
+ Event.new(to[:id], to)
25
25
  elsif to[:version]
26
- Group.new(to.delete(:id), to)
26
+ Group.new(to[:id], to)
27
27
  else
28
28
  if attributes[:context] == Application
29
- Application.new(to.delete(:id), to)
29
+ Application.new(to[:id], to)
30
30
  else
31
- User.new(to.delete(:id), to)
31
+ User.new(to[:id], to)
32
32
  end
33
33
  end
34
34
  end
@@ -13,7 +13,7 @@ module FbGraph
13
13
  type = self.to_s.underscore.split('/').last
14
14
  Searchable.search(query, options.merge(:type => type, :class => self)) do |collection|
15
15
  collection.map! do |obj|
16
- self.new(obj.delete(:id), obj.merge(
16
+ self.new(obj[:id], obj.merge(
17
17
  :access_token => options[:access_token]
18
18
  ))
19
19
  end
@@ -9,13 +9,13 @@ module FbGraph
9
9
  super
10
10
  if (from = attributes[:from])
11
11
  @from = if from[:category]
12
- Page.new(from.delete(:id), from)
12
+ Page.new(from[:id], from)
13
13
  else
14
- User.new(from.delete(:id), from)
14
+ User.new(from[:id], from)
15
15
  end
16
16
  end
17
17
  @message = attributes[:message]
18
- if (updated_time = attributes.delete(:updated_time))
18
+ if (updated_time = attributes[:updated_time])
19
19
  @updated_time = Time.parse(updated_time).utc
20
20
  end
21
21
 
data/lib/fb_graph/tag.rb CHANGED
@@ -6,13 +6,13 @@ module FbGraph
6
6
  attr_accessor :user, :name, :x, :y, :created_time
7
7
 
8
8
  def initialize(attributes = {})
9
- @x = attributes.delete(:x)
10
- @y = attributes.delete(:y)
11
- if (created_time = attributes.delete(:created_time))
12
- @created_time = Time.parse(created_time).utc
9
+ @x = attributes[:x]
10
+ @y = attributes[:y]
11
+ if attributes[:created_time]
12
+ @created_time = Time.parse(attributes[:created_time]).utc
13
13
  end
14
- if (identifier = attributes.delete(:id)).present?
15
- @user = User.new(identifier, attributes)
14
+ if attributes[:id].present?
15
+ @user = User.new(attributes[:id], attributes)
16
16
  end
17
17
  @name = attributes[:name]
18
18
  end
data/lib/fb_graph/user.rb CHANGED
@@ -61,33 +61,33 @@ module FbGraph
61
61
  @email = attributes[:email]
62
62
  @website = attributes[:website]
63
63
  if (hometown = attributes[:hometown])
64
- @hometown = Page.new(hometown.delete(:id), hometown)
64
+ @hometown = Page.new(hometown[:id], hometown)
65
65
  end
66
66
  if (location = attributes[:location])
67
- @location = Page.new(location.delete(:id), location)
67
+ @location = Page.new(location[:id], location)
68
68
  end
69
69
  @sports = []
70
70
  if (sports = attributes[:sports])
71
71
  sports.each do |sport|
72
- @sports << Page.new(sport.delete(:id), sport)
72
+ @sports << Page.new(sport[:id], sport)
73
73
  end
74
74
  end
75
75
  @favorite_teams = []
76
76
  if attributes[:favorite_teams]
77
77
  attributes[:favorite_teams].each do |favorite_team|
78
- @favorite_teams << Page.new(favorite_team.delete(:id), favorite_team)
78
+ @favorite_teams << Page.new(favorite_team[:id], favorite_team)
79
79
  end
80
80
  end
81
81
  @favorite_athletes = []
82
82
  if attributes[:favorite_athletes]
83
83
  attributes[:favorite_athletes].each do |favorite_athlete|
84
- @favorite_athletes << Page.new(favorite_athlete.delete(:id), favorite_athlete)
84
+ @favorite_athletes << Page.new(favorite_athlete[:id], favorite_athlete)
85
85
  end
86
86
  end
87
87
  @inspirational_people = []
88
88
  if attributes[:inspirational_people]
89
89
  attributes[:inspirational_people].each do |inspirational_person|
90
- @inspirational_people << Page.new(inspirational_person.delete(:id), inspirational_person)
90
+ @inspirational_people << Page.new(inspirational_person[:id], inspirational_person)
91
91
  end
92
92
  end
93
93
  @bio = attributes[:bio]
@@ -101,7 +101,7 @@ module FbGraph
101
101
  @political = attributes[:political]
102
102
  @verified = attributes[:verified]
103
103
  if (significant_other = attributes[:significant_other])
104
- @significant_other = User.new(significant_other.delete(:id), significant_other)
104
+ @significant_other = User.new(significant_other[:id], significant_other)
105
105
  end
106
106
  @timezone = attributes[:timezone]
107
107
  @locale = attributes[:locale]
@@ -109,7 +109,7 @@ module FbGraph
109
109
  @languages = []
110
110
  if attributes[:languages]
111
111
  attributes[:languages].each do |language|
112
- @languages << Page.new(language.delete(:id), language)
112
+ @languages << Page.new(language[:id], language)
113
113
  end
114
114
  end
115
115
  if attributes[:updated_time]
@@ -9,9 +9,9 @@ module FbGraph
9
9
  super
10
10
  if (from = attributes[:from])
11
11
  @from = if from[:category]
12
- Page.new(from.delete(:id), from)
12
+ Page.new(from[:id], from)
13
13
  else
14
- User.new(from.delete(:id), from)
14
+ User.new(from[:id], from)
15
15
  end
16
16
  end
17
17
  @message = attributes[:message]
data/lib/fb_graph/work.rb CHANGED
@@ -7,24 +7,24 @@ module FbGraph
7
7
  def initialize(attributes = {})
8
8
  @description = attributes[:description]
9
9
  if (employer = attributes[:employer])
10
- @employer = Page.new(employer.delete(:id), employer)
10
+ @employer = Page.new(employer[:id], employer)
11
11
  end
12
12
  if (location = attributes[:location])
13
- @location = Page.new(location.delete(:id), location)
13
+ @location = Page.new(location[:id], location)
14
14
  end
15
15
  if (position = attributes[:position])
16
- @position = Page.new(position.delete(:id), position)
16
+ @position = Page.new(position[:id], position)
17
17
  end
18
18
  @projects = []
19
19
  if attributes[:projects]
20
20
  attributes[:projects].each do |project|
21
- @projects << Project.new(project.delete(:id), project)
21
+ @projects << Project.new(project[:id], project)
22
22
  end
23
23
  end
24
24
  @with = []
25
25
  if attributes[:with]
26
26
  attributes[:with].each do |user|
27
- @with << User.new(user.delete(:id), user)
27
+ @with << User.new(user[:id], user)
28
28
  end
29
29
  end
30
30
  if attributes[:start_date] && attributes[:start_date] != '0000-00'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fb_graph
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.8.0
5
+ version: 1.8.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - nov matake
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-13 00:00:00 Z
13
+ date: 2011-05-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httpclient