fb_graph2 0.4.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cddc565f9eb2a8125c00fdfb3cf4c8d2f1d2b84
4
- data.tar.gz: a788672856bc6f8f1d093c6450125cffe5693bcc
3
+ metadata.gz: 6036910e798a2dc8d32f03de1fec4d99bcd197eb
4
+ data.tar.gz: 3cc301a00712616e7165541d2fd5fecd9b27fa7c
5
5
  SHA512:
6
- metadata.gz: dff9208b8d5be73b7befd8be218b9cbe75c11be12df3f7848aa27681b0642d4e5a6569d50b8dc446a53ee2bed75795cd1e47b269c6f8508a4f9eb65464b88bd3
7
- data.tar.gz: f9dc3900db23c416d8f923b9a45edfd731c228820ef76db95c6607ef52c0df77e0edefc989b7a2c78b581e1e1f48f02d9a9c5551f1bda2d78116b1112024e1af
6
+ metadata.gz: ed9daa2f3139f01b5611797a49fe172609c9981431409e5f95567597bdf4f4bfd877df9a55d1e765ff27ea462cfe07787e180260d12f4e372075fa7a53cc3c24
7
+ data.tar.gz: 6fe6cdf6b25d1b88c0efcf20fdceed25ba59c52a5592bb644948f04c0c91e0ad4cb26914cde97d665cf5bf72bb47bc09d81a724a000c5a7dac11922d2601f0f5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -16,7 +16,6 @@ module FbGraph2
16
16
  end
17
17
 
18
18
  def assign(attributes)
19
- self.raw_attributes = attributes
20
19
  Array(self.class.registered_attributes).each do |type, keys|
21
20
  keys.each do |key|
22
21
  if attributes.include? key
@@ -1,5 +1,7 @@
1
1
  module FbGraph2
2
2
  class Domain < Node
3
+ include Edge::Insights
4
+
3
5
  register_attributes(
4
6
  raw: [:name]
5
7
  )
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Insights
4
+ def insights(params = {})
5
+ insights = self.edge :insights, params
6
+ insights.collect! do |insight|
7
+ Insight.new(insight[:id], insight).authenticate self.access_token
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ module FbGraph2
2
+ class Insight < Node
3
+ register_attributes(
4
+ raw: [:name, :description, :title, :period],
5
+ custom: [:values]
6
+ )
7
+
8
+ def initialize(id, attributes = {})
9
+ super
10
+ self.values = attributes[:values].collect(&:with_indifferent_access)
11
+ end
12
+ end
13
+ end
@@ -9,6 +9,7 @@ module FbGraph2
9
9
 
10
10
  def initialize(id, attributes = {})
11
11
  self.id = id
12
+ self.raw_attributes = attributes
12
13
  assign attributes if respond_to? :assign
13
14
  authenticate attributes[:access_token] if attributes.include? :access_token
14
15
  end
@@ -6,6 +6,7 @@ module FbGraph2
6
6
  include Edge::Events
7
7
  include Edge::Feed
8
8
  include Edge::GlobalBrandChildren
9
+ include Edge::Insights
9
10
  include Edge::Links
10
11
  include Edge::Locations
11
12
  include Edge::Milestones
@@ -1,6 +1,7 @@
1
1
  module FbGraph2
2
2
  class Post < Node
3
3
  include Edge::Comments
4
+ include Edge::Insights
4
5
  include Edge::Likes::LikeeContext
5
6
  include Edge::SharedPosts
6
7
 
@@ -11,13 +11,13 @@ module FbGraph2
11
11
  def initialize(attributes = {})
12
12
  super :debug_token, attributes
13
13
  if app_id
14
- @app = App.new app_id
14
+ self.app = App.new app_id
15
15
  end
16
16
  if user_id
17
- @user = User.new user_id
17
+ self.user = User.new user_id
18
18
  end
19
19
  if profile_id
20
- @page = Page.new profile_id
20
+ self.page = Page.new profile_id
21
21
  end
22
22
  end
23
23
 
data/lib/fb_graph2.rb CHANGED
@@ -1,4 +1,5 @@
1
- require 'active_support/all'
1
+ require 'active_support'
2
+ require 'active_support/core_ext'
2
3
  require 'rack/oauth2'
3
4
 
4
5
  module FbGraph2
@@ -70,7 +70,7 @@ describe FbGraph2::Node do
70
70
  describe '#initialize' do
71
71
  its(:id) { should == 'identifier' }
72
72
  its(:access_token) { should be_nil }
73
- its(:raw_attributes) { should be_nil }
73
+ its(:raw_attributes) { should == {} }
74
74
  end
75
75
 
76
76
  describe '#authenticate' do
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.4.0
4
+ version: 0.4.1
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-11-26 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -192,6 +192,7 @@ files:
192
192
  - lib/fb_graph2/edge/groups.rb
193
193
  - lib/fb_graph2/edge/home.rb
194
194
  - lib/fb_graph2/edge/inbox.rb
195
+ - lib/fb_graph2/edge/insights.rb
195
196
  - lib/fb_graph2/edge/interests.rb
196
197
  - lib/fb_graph2/edge/invitable_friends.rb
197
198
  - lib/fb_graph2/edge/invited.rb
@@ -235,6 +236,7 @@ files:
235
236
  - lib/fb_graph2/friend_list.rb
236
237
  - lib/fb_graph2/group.rb
237
238
  - lib/fb_graph2/group_doc.rb
239
+ - lib/fb_graph2/insight.rb
238
240
  - lib/fb_graph2/message.rb
239
241
  - lib/fb_graph2/milestone.rb
240
242
  - lib/fb_graph2/node.rb