fb_graph2 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/fb_graph2/app.rb +13 -0
  4. data/lib/fb_graph2/comment.rb +3 -0
  5. data/lib/fb_graph2/edge/app_event_types.rb +12 -0
  6. data/lib/fb_graph2/edge/app_link_hosts.rb +12 -0
  7. data/lib/fb_graph2/edge/app_requests.rb +22 -0
  8. data/lib/fb_graph2/edge/applications.rb +12 -0
  9. data/lib/fb_graph2/edge/attending.rb +12 -0
  10. data/lib/fb_graph2/edge/banned.rb +12 -0
  11. data/lib/fb_graph2/edge/declined.rb +12 -0
  12. data/lib/fb_graph2/edge/dispute.rb +9 -0
  13. data/lib/fb_graph2/edge/docs.rb +12 -0
  14. data/lib/fb_graph2/edge/files.rb +12 -0
  15. data/lib/fb_graph2/edge/inbox.rb +12 -0
  16. data/lib/fb_graph2/edge/invited.rb +12 -0
  17. data/lib/fb_graph2/edge/maybe.rb +12 -0
  18. data/lib/fb_graph2/edge/members.rb +12 -0
  19. data/lib/fb_graph2/edge/noreply.rb +12 -0
  20. data/lib/fb_graph2/edge/outbox.rb +12 -0
  21. data/lib/fb_graph2/edge/payment_transactions.rb +12 -0
  22. data/lib/fb_graph2/edge/refunds.rb +9 -0
  23. data/lib/fb_graph2/edge/roles.rb +12 -0
  24. data/lib/fb_graph2/edge/static_resources.rb +13 -0
  25. data/lib/fb_graph2/edge/subscriptions.rb +12 -0
  26. data/lib/fb_graph2/edge/tagged_places.rb +12 -0
  27. data/lib/fb_graph2/edge/tags.rb +17 -0
  28. data/lib/fb_graph2/edge/test_users.rb +12 -0
  29. data/lib/fb_graph2/edge/translations.rb +17 -0
  30. data/lib/fb_graph2/event.rb +10 -0
  31. data/lib/fb_graph2/friend_list.rb +2 -0
  32. data/lib/fb_graph2/group.rb +6 -0
  33. data/lib/fb_graph2/group_doc.rb +9 -0
  34. data/lib/fb_graph2/milestone.rb +4 -0
  35. data/lib/fb_graph2/node.rb +1 -0
  36. data/lib/fb_graph2/payment.rb +3 -0
  37. data/lib/fb_graph2/photo.rb +1 -0
  38. data/lib/fb_graph2/struct/app_event_type.rb +25 -0
  39. data/lib/fb_graph2/struct/group_file.rb +12 -0
  40. data/lib/fb_graph2/struct/role.rb +9 -0
  41. data/lib/fb_graph2/struct/static_resource.rb +17 -0
  42. data/lib/fb_graph2/struct/subscription.rb +9 -0
  43. data/lib/fb_graph2/translation.rb +7 -0
  44. data/lib/fb_graph2/user.rb +20 -3
  45. data/lib/fb_graph2/video.rb +4 -0
  46. data/spec/fb_graph2/edge/subscriptions_spec.rb +18 -0
  47. data/spec/fb_graph2/edge/test_users_spec.rb +19 -0
  48. data/spec/fb_graph2_spec.rb +1 -0
  49. data/spec/mock_json/app/subscriptions.json +8 -0
  50. data/spec/mock_json/app/test_users.json +17 -0
  51. metadata +38 -3
  52. data/spec/fb_graph2/page_spec.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5596c03f7eb3eaaf04d9e4ded6d72c5468807781
4
- data.tar.gz: 8ff0e6c72704f8181507d184a270507e8b0bf990
3
+ metadata.gz: 3c8a159c7d77db9a3e0dc1c216b48af33b13607b
4
+ data.tar.gz: cd9d38bc8c9d472dbb2bdd46066a564b63cb1e68
5
5
  SHA512:
6
- metadata.gz: e4fdcdbbb437eeb097f3e4605c9eaee73d6146af7cecdad1ccd3a65183883ea501f744314af0c6ceae04aed86a5c1fc7233625e2edd813c9b6f706d0882271f7
7
- data.tar.gz: a1c0c0ff0e723dbdd115d4717f8795a27456cbd9737c3bee3e02cf19d622fa130b89751b59bf01ac904fe61147b578840df336e30d22b6f1b89ab97f1f212585
6
+ metadata.gz: 88849dbc9b87d5686b0c9aef2958e0a30fd796350d1d079c9bb44da9b55eee6b551dcc80b1c3de82001106cfcb3ca518425a8daa8f323d529b1e01c1ab0f0c3a
7
+ data.tar.gz: 65dfae68dd22c6e6308c7df7e409bc42d2d6ee08ef556ca615593fab9de008441417a0cac46a7753c1ef74981f25e13e711d5ff46ed28d48baea2360ba54a6c7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -1,5 +1,18 @@
1
1
  module FbGraph2
2
2
  class App < Node
3
+ include Edge::Achievements
4
+ include Edge::AppLinkHosts
5
+ include Edge::AppEventTypes
6
+ include Edge::Banned
7
+ include Edge::Groups
8
+ include Edge::Picture
9
+ include Edge::Roles
10
+ include Edge::Scores
11
+ include Edge::StaticResources
12
+ include Edge::Subscriptions
13
+ include Edge::TestUsers
14
+ include Edge::Translations
15
+
3
16
  register_attributes(
4
17
  raw: [
5
18
  :id, :android_key_hash, :app_domains, :auth_dialog_data_help_url, :auth_dialog_headline,
@@ -1,5 +1,8 @@
1
1
  module FbGraph2
2
2
  class Comment < Node
3
+ include Edge::Comments
4
+ include Edge::Likes::LikeeContext
5
+
3
6
  register_attributes(
4
7
  raw: [:can_comment, :can_remove, :comment_count, :like_count, :message, :user_likes],
5
8
  time: [:created_time],
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module AppEventTypes
4
+ def app_event_types(params = {})
5
+ types = self.edge :app_event_types, params
6
+ types.collect do |type|
7
+ Struct::AppEventType.new type
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module AppLinkHosts
4
+ def app_link_hosts(params = {})
5
+ hosts = self.edge :app_link_hosts, params
6
+ hosts.collect do |host|
7
+ AppLinkHost.new(hosts[:id], hosts).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,22 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module AppRequests
4
+ def app_requests(params = {})
5
+ requests = self.edge :apprequests, params
6
+ requests.collect do |request|
7
+ Request.new(request[:id], request).authenticate self.access_token
8
+ end
9
+ end
10
+ alias_method :apprequests, :app_requests
11
+
12
+ def app_request!(params = {})
13
+ response = self.post params, edge: :apprequests
14
+ if request = response[:request]
15
+ response[:request] = Request.new(request[:id], request).authenticate self.access_token
16
+ end
17
+ response
18
+ end
19
+ alias_method :apprequest!, :app_request!
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Applications
4
+ def applications(params = {})
5
+ apps = self.edge :applications, params, edge_scope: :developer
6
+ apps.collect do |app|
7
+ App.new(app[:id], app).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Attending
4
+ def attending(params = {})
5
+ users = self.edge :attending, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Banned
4
+ def banned(params = {})
5
+ users = self.edge :banned, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Declined
4
+ def declined(params = {})
5
+ users = self.edge :declined, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Dispute
4
+ def dispute!(params = {})
5
+ self.post params, edge: :dispute
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Docs
4
+ def docs(params = {})
5
+ docs = self.edge :docs, params
6
+ docs.collect do |doc|
7
+ GroupDoc.new(doc[:id], doc).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Files
4
+ def files(params = {})
5
+ files = self.edge :files, params
6
+ files.collect do |file|
7
+ Struct::GroupFile.new file
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Inbox
4
+ def inbox(params = {})
5
+ threads = self.edge :inbox, params
6
+ threads.collect do |thread|
7
+ Thread.new(thread[:id], thread).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Invited
4
+ def invited(params = {})
5
+ users = self.edge :invited, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Maybe
4
+ def maybe(params = {})
5
+ users = self.edge :maybe, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Members
4
+ def members(params = {})
5
+ users = self.edge :members, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Noreply
4
+ def noreply(params = {})
5
+ users = self.edge :noreply, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Outbox
4
+ def outbox(params = {})
5
+ threads = self.edge :outbox, params
6
+ threads.collect do |thread|
7
+ Thread.new(thread[:id], thread).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module PaymentTransactions
4
+ def payment_transactions(params = {})
5
+ payments = self.edge :payment_transactions, params
6
+ payments.collect do |payment|
7
+ Payment.new(payment[:id], payment).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Refunds
4
+ def refund!(params = {})
5
+ self.post params, edge: :refund
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Roles
4
+ def roles(params = {})
5
+ roles = self.edge :roles, params
6
+ roles.collect do |role|
7
+ Struct::Role.new role
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module StaticResources
4
+ def static_resources(params = {})
5
+ resources = self.edge :staticresources, params
6
+ resources.collect do |resource|
7
+ Struct::StaticResource.new resource
8
+ end
9
+ end
10
+ alias_method :staticresources, :static_resources
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Subscriptions
4
+ def subscriptions(params = {})
5
+ subscriptions = self.edge :subscriptions, params
6
+ subscriptions.collect do |subscription|
7
+ Struct::Subscription.new subscription
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module TaggedPlaces
4
+ def tagged_places(params = {})
5
+ place_tags = self.edge :tagged_places, params
6
+ place_tags.collect do |place_tag|
7
+ PlaceTag.new(place_tag[:id], place_tag).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Tags
4
+ def tags(params = {})
5
+ users = self.edge :tags, params
6
+ users.collect do |user|
7
+ User.new(user[:id], user).authenticate self.access_token
8
+ end
9
+ end
10
+
11
+ # NOTE: available both for create & update
12
+ def tag!(params = {})
13
+ self.post params, edge: :tags
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module TestUsers
4
+ def test_users(params = {})
5
+ users = self.edge :accounts, params, edge_scope: :'test-users'
6
+ users.collect do |user|
7
+ User.new(user[:id], user)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Translations
4
+ def translations(params = {})
5
+ translations = self.edge :translations, params
6
+ translations.collect do |translation|
7
+ Translation.new(translation[:id], translation).authenticate self.authenticate
8
+ end
9
+ end
10
+
11
+ def translation!(params = {})
12
+ self.post params, edge: :translations
13
+ end
14
+ alias_method :translate!, :translation!
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,15 @@
1
1
  module FbGraph2
2
2
  class Event < Node
3
+ include Edge::Attending
4
+ include Edge::Declined
5
+ include Edge::Feed
6
+ include Edge::Invited
7
+ include Edge::Maybe
8
+ include Edge::Noreply
9
+ include Edge::Picture
10
+ include Edge::Photos
11
+ include Edge::Videos
12
+
3
13
  register_attributes(
4
14
  raw: [:description, :is_date_only, :location, :name, :privacy, :ticket_uri, :timezone],
5
15
  time: [:end_time, :start_time, :updated_time],
@@ -1,5 +1,7 @@
1
1
  module FbGraph2
2
2
  class FriendList < Node
3
+ include Edge::Members
4
+
3
5
  register_attributes(
4
6
  raw: [:name, :list_type]
5
7
  )
@@ -1,5 +1,11 @@
1
1
  module FbGraph2
2
2
  class Group < Node
3
+ include Edge::Docs
4
+ include Edge::Events
5
+ include Edge::Feed
6
+ include Edge::Files
7
+ include Edge::Members
8
+
3
9
  register_attributes(
4
10
  raw: [
5
11
  :description, :email, :icon, :link, :name, :privacy,
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class GroupDoc < Node
3
+ register_attributes(
4
+ raw: [:subject, :message, :icon, :revision, :can_edit, :can_delete],
5
+ time: [:created_time, :updated_time],
6
+ profile: [:from]
7
+ )
8
+ end
9
+ end
@@ -1,5 +1,9 @@
1
1
  module FbGraph2
2
2
  class Milestone < Node
3
+ include Edge::Comments
4
+ include Edge::Likes::LikeeContext
5
+ include Edge::Photos
6
+
3
7
  register_attributes(
4
8
  raw: [:title, :description],
5
9
  time: [:created_time, :updated_time, :start_time, :end_time],
@@ -10,6 +10,7 @@ module FbGraph2
10
10
  def initialize(id, attributes = {})
11
11
  self.id = id
12
12
  assign attributes if respond_to? :assign
13
+ authenticate attributes[:access_token] if attributes.include? :access_token
13
14
  end
14
15
 
15
16
  def authenticate(access_token)
@@ -1,5 +1,8 @@
1
1
  module FbGraph2
2
2
  class Payment < Node
3
+ include Edge::Dispute
4
+ include Edge::Refunds
5
+
3
6
  register_attributes(
4
7
  raw: [:product, :quantity, :request_id, :country, :created_time, :payout_foreign_exchange_rate, :test],
5
8
  time: [:created_time, :updated_time],
@@ -2,6 +2,7 @@ module FbGraph2
2
2
  class Photo < Node
3
3
  include Edge::Comments
4
4
  include Edge::Likes::LikeeContext
5
+ include Edge::Tags
5
6
 
6
7
  register_attributes(
7
8
  raw: [
@@ -0,0 +1,25 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class AppEventType < Struct
4
+ register_attributes(
5
+ raw: [:event_name, :display_name, :description],
6
+ custom: [:parameters]
7
+ )
8
+
9
+ class Parameter < Struct
10
+ register_attributes(
11
+ raw: [:parameter_name, :display_name, :description]
12
+ )
13
+ end
14
+
15
+ def initialize(attributes = {})
16
+ super
17
+ if attributes.include? :parameters
18
+ self.parameters = Collection.new(attributes[:parameters]).collect do |param|
19
+ Parameter.new param
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class GroupFile < Struct
4
+ register_attributes(
5
+ raw: [:id, :download_link],
6
+ time: [:updated_time],
7
+ user: [:from],
8
+ group: [:group]
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class Role < Struct
4
+ register_attributes(
5
+ raw: [:app_id, :user, :role]
6
+ )
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class StaticResource < Struct
4
+ register_attributes(
5
+ raw: [:usage_stats, :prefetched_resources],
6
+ custom: [:https]
7
+ )
8
+
9
+ def initialize(attributes = {})
10
+ super
11
+ if attributes.include? :https
12
+ self.https = self.class.new attributes[:https]
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class Subscription < Struct
4
+ register_attributes(
5
+ raw: [:object, :callback_url, :fields, :active]
6
+ )
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module FbGraph2
2
+ class Translation < Node
3
+ register_attributes(
4
+ raw: [:translation, :approval_status, :native_string, :description]
5
+ )
6
+ end
7
+ end
@@ -4,6 +4,8 @@ module FbGraph2
4
4
  include Edge::Achievements
5
5
  include Edge::Activities
6
6
  include Edge::Albums
7
+ include Edge::Applications
8
+ include Edge::AppRequests
7
9
  include Edge::Books
8
10
  include Edge::Events
9
11
  include Edge::Family
@@ -13,6 +15,7 @@ module FbGraph2
13
15
  include Edge::Games
14
16
  include Edge::Groups
15
17
  include Edge::Home
18
+ include Edge::Inbox
16
19
  include Edge::Interests
17
20
  include Edge::InvitableFriends
18
21
  include Edge::Likes::LikerContext
@@ -20,6 +23,8 @@ module FbGraph2
20
23
  include Edge::Movies
21
24
  include Edge::Music
22
25
  include Edge::Notifications
26
+ include Edge::Outbox
27
+ include Edge::PaymentTransactions
23
28
  include Edge::Permissions
24
29
  include Edge::Picture
25
30
  include Edge::Photos
@@ -28,6 +33,7 @@ module FbGraph2
28
33
  include Edge::Scores
29
34
  include Edge::Statuses
30
35
  include Edge::Tagged
36
+ include Edge::TaggedPlaces
31
37
  include Edge::Television
32
38
  include Edge::Videos
33
39
 
@@ -39,13 +45,24 @@ module FbGraph2
39
45
  # NOTE: in family edge context
40
46
  :relationship,
41
47
  # NOTE: in page admin context
42
- :perms, :role
48
+ :perms, :role,
49
+ # NOTE: in photo tags context
50
+ :x, :y
51
+ ],
52
+ time: [
53
+ # NOTE: undocumented attribute
54
+ :updated_time,
55
+ # NOTE: in photo tags context
56
+ :created_time
43
57
  ],
44
- time: [:updated_time], # NOTE: undocumented attribute
45
58
  date: [:birthday],
46
59
  page: [:hometown, :location],
47
60
  pages: [:favorite_athletes, :favorite_teams, :inspirational_people, :languages],
48
- user: [:significant_other],
61
+ user: [
62
+ :significant_other,
63
+ # NOTE: in photo tags context
64
+ :tagging_user
65
+ ],
49
66
  photo: [:cover],
50
67
  custom: [:age_range, :context, :currency, :education, :work]
51
68
  )
@@ -1,5 +1,9 @@
1
1
  module FbGraph2
2
2
  class Video < Node
3
+ include Edge::Comments
4
+ include Edge::Likes::LikeeContext
5
+ include Edge::SharedPosts
6
+
3
7
  register_attributes(
4
8
  raw: [:description, :embed_html, :icon, :length, :name, :picture, :source],
5
9
  time: [:created_time, :updated_time],
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe FbGraph2::Edge::Subscriptions do
4
+ context 'included in App' do
5
+ describe '#subscriptions' do
6
+ let(:app) { FbGraph2::App.app('app_token') }
7
+ it 'should return an Array of FbGraph2::Struct::Subscription' do
8
+ subscriptions = mock_graph :get, 'app/subscriptions', 'app/subscriptions', access_token: 'app_token' do
9
+ app.subscriptions
10
+ end
11
+ subscriptions.should_not be_blank
12
+ subscriptions.each do |subscription|
13
+ subscription.should be_instance_of FbGraph2::Struct::Subscription
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe FbGraph2::Edge::TestUsers do
4
+ context 'included in App' do
5
+ describe '#test_users' do
6
+ let(:app) { FbGraph2::App.app('app_token') }
7
+ it 'should return an Array of FbGraph2::User with test_user token' do
8
+ users = mock_graph :get, 'app/accounts/test-users', 'app/test_users', access_token: 'app_token' do
9
+ app.test_users
10
+ end
11
+ users.should_not be_blank
12
+ users.each do |user|
13
+ user.should be_instance_of FbGraph2::User
14
+ user.access_token.should == 'test_user_token'
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -8,6 +8,7 @@ describe FbGraph2 do
8
8
  its(:logger) { should be_a Logger }
9
9
  its(:api_version) { should == 'v2.0' }
10
10
  its(:root_url) { should == 'https://graph.facebook.com/v2.0' }
11
+ its(:object_classes) { should contain_exactly *FbGraph2::Node.subclasses }
11
12
  it { should_not be_debugging }
12
13
  end
13
14
 
@@ -0,0 +1,8 @@
1
+ {
2
+ "data": [{
3
+ "object": "user",
4
+ "callback_url": "http://fbgraphsample.heroku.com/subscriptions/7",
5
+ "fields": ["email"],
6
+ "active": true
7
+ }]
8
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "data": [{
3
+ "id": "100003934202581",
4
+ "login_url": "https://developers.facebook.com/checkpoint/test-user-login/100003934202581/",
5
+ "access_token": "test_user_token"
6
+ }, {
7
+ "id": "100003888272508",
8
+ "login_url": "https://developers.facebook.com/checkpoint/test-user-login/100003888272508/",
9
+ "access_token": "test_user_token"
10
+ }],
11
+ "paging": {
12
+ "cursors": {
13
+ "before": "MTAwMDAzOTM0MjAyNTgx",
14
+ "after": "MTAwMDAzODg4MjcyNTA4"
15
+ }
16
+ }
17
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_graph2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -166,43 +166,69 @@ files:
166
166
  - lib/fb_graph2/edge/activities.rb
167
167
  - lib/fb_graph2/edge/admins.rb
168
168
  - lib/fb_graph2/edge/albums.rb
169
+ - lib/fb_graph2/edge/app_event_types.rb
170
+ - lib/fb_graph2/edge/app_link_hosts.rb
171
+ - lib/fb_graph2/edge/app_requests.rb
172
+ - lib/fb_graph2/edge/applications.rb
173
+ - lib/fb_graph2/edge/attending.rb
174
+ - lib/fb_graph2/edge/banned.rb
169
175
  - lib/fb_graph2/edge/blocked.rb
170
176
  - lib/fb_graph2/edge/books.rb
171
177
  - lib/fb_graph2/edge/comments.rb
178
+ - lib/fb_graph2/edge/declined.rb
179
+ - lib/fb_graph2/edge/dispute.rb
180
+ - lib/fb_graph2/edge/docs.rb
172
181
  - lib/fb_graph2/edge/events.rb
173
182
  - lib/fb_graph2/edge/family.rb
174
183
  - lib/fb_graph2/edge/feed.rb
184
+ - lib/fb_graph2/edge/files.rb
175
185
  - lib/fb_graph2/edge/friend_lists.rb
176
186
  - lib/fb_graph2/edge/friends.rb
177
187
  - lib/fb_graph2/edge/games.rb
178
188
  - lib/fb_graph2/edge/global_brand_children.rb
179
189
  - lib/fb_graph2/edge/groups.rb
180
190
  - lib/fb_graph2/edge/home.rb
191
+ - lib/fb_graph2/edge/inbox.rb
181
192
  - lib/fb_graph2/edge/interests.rb
182
193
  - lib/fb_graph2/edge/invitable_friends.rb
194
+ - lib/fb_graph2/edge/invited.rb
183
195
  - lib/fb_graph2/edge/likes.rb
184
196
  - lib/fb_graph2/edge/links.rb
185
197
  - lib/fb_graph2/edge/locations.rb
198
+ - lib/fb_graph2/edge/maybe.rb
199
+ - lib/fb_graph2/edge/members.rb
186
200
  - lib/fb_graph2/edge/milestones.rb
187
201
  - lib/fb_graph2/edge/movies.rb
188
202
  - lib/fb_graph2/edge/music.rb
203
+ - lib/fb_graph2/edge/noreply.rb
189
204
  - lib/fb_graph2/edge/notifications.rb
190
205
  - lib/fb_graph2/edge/offers.rb
206
+ - lib/fb_graph2/edge/outbox.rb
207
+ - lib/fb_graph2/edge/payment_transactions.rb
191
208
  - lib/fb_graph2/edge/permissions.rb
192
209
  - lib/fb_graph2/edge/photos.rb
193
210
  - lib/fb_graph2/edge/picture.rb
194
211
  - lib/fb_graph2/edge/pokes.rb
195
212
  - lib/fb_graph2/edge/posts.rb
196
213
  - lib/fb_graph2/edge/promotable_posts.rb
214
+ - lib/fb_graph2/edge/refunds.rb
215
+ - lib/fb_graph2/edge/roles.rb
197
216
  - lib/fb_graph2/edge/scores.rb
198
217
  - lib/fb_graph2/edge/shared_posts.rb
218
+ - lib/fb_graph2/edge/static_resources.rb
199
219
  - lib/fb_graph2/edge/statuses.rb
220
+ - lib/fb_graph2/edge/subscriptions.rb
200
221
  - lib/fb_graph2/edge/tagged.rb
222
+ - lib/fb_graph2/edge/tagged_places.rb
223
+ - lib/fb_graph2/edge/tags.rb
201
224
  - lib/fb_graph2/edge/television.rb
225
+ - lib/fb_graph2/edge/test_users.rb
226
+ - lib/fb_graph2/edge/translations.rb
202
227
  - lib/fb_graph2/edge/videos.rb
203
228
  - lib/fb_graph2/event.rb
204
229
  - lib/fb_graph2/friend_list.rb
205
230
  - lib/fb_graph2/group.rb
231
+ - lib/fb_graph2/group_doc.rb
206
232
  - lib/fb_graph2/message.rb
207
233
  - lib/fb_graph2/milestone.rb
208
234
  - lib/fb_graph2/node.rb
@@ -221,14 +247,20 @@ files:
221
247
  - lib/fb_graph2/review.rb
222
248
  - lib/fb_graph2/struct.rb
223
249
  - lib/fb_graph2/struct/action.rb
250
+ - lib/fb_graph2/struct/app_event_type.rb
224
251
  - lib/fb_graph2/struct/app_link.rb
252
+ - lib/fb_graph2/struct/group_file.rb
225
253
  - lib/fb_graph2/struct/image_source.rb
226
254
  - lib/fb_graph2/struct/invitable_friend.rb
227
255
  - lib/fb_graph2/struct/permission.rb
228
256
  - lib/fb_graph2/struct/picture.rb
229
257
  - lib/fb_graph2/struct/poke.rb
258
+ - lib/fb_graph2/struct/role.rb
230
259
  - lib/fb_graph2/struct/score.rb
260
+ - lib/fb_graph2/struct/static_resource.rb
261
+ - lib/fb_graph2/struct/subscription.rb
231
262
  - lib/fb_graph2/thread.rb
263
+ - lib/fb_graph2/translation.rb
232
264
  - lib/fb_graph2/user.rb
233
265
  - lib/fb_graph2/util.rb
234
266
  - lib/fb_graph2/video.rb
@@ -265,17 +297,20 @@ files:
265
297
  - spec/fb_graph2/edge/scores_spec.rb
266
298
  - spec/fb_graph2/edge/shared_posts_spec.rb
267
299
  - spec/fb_graph2/edge/statuses_spec.rb
300
+ - spec/fb_graph2/edge/subscriptions_spec.rb
268
301
  - spec/fb_graph2/edge/television_spec.rb
302
+ - spec/fb_graph2/edge/test_users_spec.rb
269
303
  - spec/fb_graph2/edge/videos_spec.rb
270
304
  - spec/fb_graph2/node_spec.rb
271
305
  - spec/fb_graph2/node_subclass_spec.rb
272
- - spec/fb_graph2/page_spec.rb
273
306
  - spec/fb_graph2/request_filter/authenticator_spec.rb
274
307
  - spec/fb_graph2/request_filter/debugger_spec.rb
275
308
  - spec/fb_graph2/user_spec.rb
276
309
  - spec/fb_graph2/util_spec.rb
277
310
  - spec/fb_graph2_spec.rb
278
311
  - spec/mock_json/app/app.json
312
+ - spec/mock_json/app/subscriptions.json
313
+ - spec/mock_json/app/test_users.json
279
314
  - spec/mock_json/blank_collection.json
280
315
  - spec/mock_json/error/400/2500.json
281
316
  - spec/mock_json/error/invalid_format.json
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe FbGraph2::Page do
4
- it :TODO
5
- end