fb_graph2 0.0.10 → 0.0.11

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: 1af0e224676e1044415d1c7ab404ac7a3075d928
4
- data.tar.gz: a36ce895a0505932928620bb85c850af2a9efa87
3
+ metadata.gz: b4f60a4edc36068c5e05c3b7e63431744ab0da6c
4
+ data.tar.gz: b5fa5048e0e41fe3f9264038dc3c028ab323a086
5
5
  SHA512:
6
- metadata.gz: 1b15b62cc89590170ceaf6708d3482f1b3590bbdf86af49ae665f0568c3700c5fccfa7e77950dbf171bf517b3364c2854faac63aefdd84e96cb339c79a2db038
7
- data.tar.gz: 6eea1e64881125e86432e817ca957e4010150823964deb31e2892a7c6fa93df2793192154083c617fd59454e95e218be29b336835dde840d159983eca6461f12
6
+ metadata.gz: 0e07ffef61980cc47920ef52472d7000bd54879f45fa48eb4d4734622d86d03e906b39140971efd9943c601bc90207fa2b34e2e6368e950517f31d98ea720a4c
7
+ data.tar.gz: 5c3e5d12925f9e802522438446c609d6a82cf28b2e413c7c77db62967285c45ff78ad8f65dabee1681b46d7f3ec519936fc7ff689709fa8a8e44ede8222437cc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -29,7 +29,7 @@ module FbGraph2
29
29
  when :date
30
30
  Date.strptime raw, '%m/%d/%Y' rescue raw
31
31
  when :time
32
- Time.parse raw
32
+ Time.parse raw rescue raw
33
33
  when :timestamp
34
34
  Time.at raw
35
35
  when :actions
@@ -70,6 +70,10 @@ module FbGraph2
70
70
  end
71
71
  when :user
72
72
  User.new raw[:id], raw
73
+ when :users
74
+ Collection.new(raw).collect do |_raw_|
75
+ User.new _raw_[:id], _raw_
76
+ end
73
77
  else
74
78
  # NOTE: handle these attributes in each class
75
79
  next
@@ -96,7 +96,14 @@ module FbGraph2
96
96
  end
97
97
 
98
98
  def build_params(params = {})
99
- params.present? ? params : nil
99
+ if params.present?
100
+ if params.include? :fields
101
+ params[:fields] = Array(params[:fields]).join(',')
102
+ end
103
+ params
104
+ else
105
+ nil
106
+ end
100
107
  end
101
108
 
102
109
  def handle_response
@@ -36,7 +36,7 @@ module FbGraph2
36
36
  page: [:best_page],
37
37
  photo: [:cover],
38
38
  users: [
39
- # NOTE: only as Struct::Work#projects
39
+ # NOTE: only as Struct::Education#classes and Struct::Work#projects
40
40
  :with
41
41
  ],
42
42
  custom: [
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class Device < Struct
4
+ register_attributes(
5
+ raw: [:hardware, :os]
6
+ )
7
+ end
8
+ end
9
+ end
@@ -4,7 +4,7 @@ module FbGraph2
4
4
  register_attributes(
5
5
  raw: [:type],
6
6
  page: [:school, :year],
7
- pages: [:concentration]
7
+ pages: [:classes, :concentration]
8
8
  )
9
9
  end
10
10
  end
@@ -39,7 +39,7 @@ module FbGraph2
39
39
 
40
40
  register_attributes(
41
41
  raw: [
42
- :about, :bio, :email, :first_name, :gender, :installed, :is_verified, :link, :locale,
42
+ :about, :bio, :email, :first_name, :gender, :installed, :is_verified, :last_name, :link, :locale,
43
43
  :middle_name, :name, :name_format, :political, :quotes, :relationship_status, :religion,
44
44
  :timezone, :third_party_id, :verified, :website,
45
45
  # NOTE: in family edge context
@@ -64,7 +64,7 @@ module FbGraph2
64
64
  :tagging_user
65
65
  ],
66
66
  photo: [:cover],
67
- custom: [:age_range, :context, :currency, :education, :work]
67
+ custom: [:age_range, :context, :currency, :devices, :education, :work]
68
68
  )
69
69
 
70
70
  def initialize(id, attributes = {})
@@ -78,11 +78,20 @@ module FbGraph2
78
78
  if attributes.include? :currency
79
79
  self.currency = Struct::Currency.new attributes[:currency]
80
80
  end
81
+ if attributes.include? :devices
82
+ self.devices = attributes[:devices].collect do |device|
83
+ Struct::Device.new device
84
+ end
85
+ end
81
86
  if attributes.include? :education
82
- self.education = Struct::Education.new attributes[:education]
87
+ self.education = attributes[:education].collect do |education|
88
+ Struct::Education.new education
89
+ end
83
90
  end
84
91
  if attributes.include? :work
85
- self.work = Struct::Work.new attributes[:work]
92
+ self.work = attributes[:work].collect do |work|
93
+ Struct::Work.new work
94
+ end
86
95
  end
87
96
  end
88
97
 
@@ -90,4 +99,4 @@ module FbGraph2
90
99
  new(:me).authenticate access_token
91
100
  end
92
101
  end
93
- end
102
+ end
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.10
4
+ version: 0.0.11
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-30 00:00:00.000000000 Z
11
+ date: 2014-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -256,6 +256,7 @@ files:
256
256
  - lib/fb_graph2/struct/app_link.rb
257
257
  - lib/fb_graph2/struct/context.rb
258
258
  - lib/fb_graph2/struct/currency.rb
259
+ - lib/fb_graph2/struct/device.rb
259
260
  - lib/fb_graph2/struct/education.rb
260
261
  - lib/fb_graph2/struct/group_file.rb
261
262
  - lib/fb_graph2/struct/image_source.rb