fellowshipone 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df5c9b89ae1ee55d15f5f465d12362df2a5827e0
4
- data.tar.gz: 31178b96d931d9bc59a9ab5abbc60a3bf0599acf
3
+ metadata.gz: f4e11ab742f6434a9fdbad47eb2ad76ff6a541d7
4
+ data.tar.gz: 0ea42375b6bdadc9d1a33eeca8dd4d9bad9ef928
5
5
  SHA512:
6
- metadata.gz: 5c0908f2f48f67bd77ef693c46d00e913b7e461d5746cf2734013be40d8ebb8f87dab709377c36288af96856abf19faf561c7a8381bff1a8712ea00724a7fddf
7
- data.tar.gz: 26e358fb0e9f417dd8fc39ff23c802efa31ea9c8b5a8204c649852b2f0226a5d2753ec657f0a2ee83aa706df4e58a99edf8e52d9fd486e4db57485a8822d2d66
6
+ metadata.gz: '08e01e74f88a62afacd80d646293e0dfbb626a16f106fec26d00de022fda3bd2ec60daebc39182df420dfd2beac87276d26ca5f22ad4c130dd2c9c50973fd214'
7
+ data.tar.gz: fd72fbf2ef5a1535486de53b524c8805e24898d09e104582325b2b22f5ad34add06312855597601dcfdda4f5a7e0f87af112f7822aa96782899e32372d160a6f
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'fellowshipone'
5
- s.version = '2.1.0'
5
+ s.version = '2.2.0'
6
6
  s.authors = ['Taylor Brooks']
7
7
  s.email = ['tbrooks@gmail.com']
8
8
  s.homepage = 'https://github.com/taylorbrooks/fellowshipone'
@@ -12,7 +12,8 @@ module Fellowshipone
12
12
  end
13
13
 
14
14
  def subfunds(fund_id)
15
- get("/giving/v1/funds/#{fund_id}/subfunds")
15
+ response = get("/giving/v1/funds/#{fund_id}/subfunds")
16
+ Fellowshipone::SubFund.format(response)
16
17
  end
17
18
 
18
19
  end
@@ -1,8 +1,7 @@
1
1
  module Fellowshipone
2
2
  class Fund
3
-
4
3
  def self.format(res)
5
- response = res["funds"]["fund"]
4
+ response = res['funds']['fund']
6
5
  if response.is_a?(Array)
7
6
  response.map{|fund| format_fund(fund) }
8
7
  else
@@ -0,0 +1,22 @@
1
+ module Fellowshipone
2
+ class SubFund
3
+ def self.format(res)
4
+ return nil if res['subFunds'].nil?
5
+
6
+ response = res['subFunds']['subFund']
7
+
8
+ if response.is_a?(Array)
9
+ response.map{|fund| format_fund(fund) }
10
+ else
11
+ format_fund(response)
12
+ end
13
+ end
14
+
15
+ def self.format_fund(fund)
16
+ OpenStruct.new(
17
+ id: fund['@id'],
18
+ name: fund['name'],
19
+ )
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fellowshipone
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-12 00:00:00.000000000 Z
11
+ date: 2019-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -203,6 +203,7 @@ files:
203
203
  - lib/fellowshipone/resources/pledge_drive.rb
204
204
  - lib/fellowshipone/responses/contribution.rb
205
205
  - lib/fellowshipone/responses/fund.rb
206
+ - lib/fellowshipone/responses/sub_fund.rb
206
207
  - test/person/person_test.rb
207
208
  - test/test_helper.rb
208
209
  - tester.rb
@@ -226,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
227
  version: '0'
227
228
  requirements: []
228
229
  rubyforge_project:
229
- rubygems_version: 2.4.8
230
+ rubygems_version: 2.6.13
230
231
  signing_key:
231
232
  specification_version: 4
232
233
  summary: Ruby gem/plugin to interact with the FellowshipOne API (https://developer.fellowshipone.com/).