shelby-arena-api 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api/contribution.rb +16 -19
- data/lib/api/contribution_split.rb +19 -0
- data/shelby_arena_api.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9826fd1a5ce9bef8139376da2008ada533251a89
|
4
|
+
data.tar.gz: 7107de35fac53454897254a7fd37ac971fc4babc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51b93c1f1a8326f20b8df241693ea443d73c470b8c2e7cbd2518a8a806b94f0240c5c66d954dc0356cf6fb2ca001eb39a76af7cf3b4fd64375226c1499e6ff0
|
7
|
+
data.tar.gz: 4fe819e19913cb1cf67118974310e471ac9c3de1d473f21d0d052d27783784892329934a73591a8fdc6c3a7535465bdaf3393e0c20ffdcc9cff5339b0ca8356d
|
data/lib/api/contribution.rb
CHANGED
@@ -40,24 +40,6 @@ module ShelbyArena
|
|
40
40
|
|
41
41
|
# Helper methods
|
42
42
|
|
43
|
-
def fund_id
|
44
|
-
begin
|
45
|
-
self.contribution_funds['ContributionFund']['Fund']['FundId']
|
46
|
-
rescue
|
47
|
-
nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
def fund_name
|
53
|
-
begin
|
54
|
-
self.contribution_funds['ContributionFund']['Fund']['FundName']
|
55
|
-
rescue
|
56
|
-
nil
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
43
|
def first_name_with_nickname
|
62
44
|
begin
|
63
45
|
fname = self.person_information['FirstName']
|
@@ -88,7 +70,22 @@ module ShelbyArena
|
|
88
70
|
nil
|
89
71
|
end
|
90
72
|
end
|
91
|
-
|
73
|
+
|
74
|
+
|
75
|
+
def contribution_splits
|
76
|
+
begin
|
77
|
+
if self.contribution_funds['ContributionFund'].is_a?(Array)
|
78
|
+
self.contribution_funds['ContributionFund'].collect { |data| ContributionSplit.new(data) }
|
79
|
+
elsif self.contribution_funds['ContributionFund'].is_a?(Hash)
|
80
|
+
[ ContributionSplit.new( self.contribution_funds['ContributionFund'] ) ]
|
81
|
+
else
|
82
|
+
[] # Something else
|
83
|
+
end
|
84
|
+
rescue
|
85
|
+
nil
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
92
89
|
end
|
93
90
|
|
94
91
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ShelbyArena
|
2
|
+
|
3
|
+
class ContributionSplit < ApiObject
|
4
|
+
attribute :amount, Float
|
5
|
+
attribute :fund_id, Integer
|
6
|
+
attribute :fund_name, String
|
7
|
+
|
8
|
+
# Constructor.
|
9
|
+
#
|
10
|
+
# @param data .
|
11
|
+
def initialize(data)
|
12
|
+
self.amount = data['Amount'].to_f
|
13
|
+
self.fund_id = data['Fund']['FundId'].to_i
|
14
|
+
self.fund_name = data['Fund']['FundName']
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/shelby_arena_api.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelby-arena-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wes Hays
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/api/api_object.rb
|
60
60
|
- lib/api/contribution.rb
|
61
61
|
- lib/api/contribution_list.rb
|
62
|
+
- lib/api/contribution_split.rb
|
62
63
|
- lib/api/family.rb
|
63
64
|
- lib/api/fund.rb
|
64
65
|
- lib/api/fund_list.rb
|