shelby_arena 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shelby_arena/resources/fund.rb +2 -1
- data/lib/shelby_arena/resources/person.rb +1 -1
- data/lib/shelby_arena/response/base.rb +1 -1
- data/lib/shelby_arena/response/fund.rb +6 -1
- data/lib/shelby_arena/response/person.rb +12 -2
- data/lib/shelby_arena/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80f385f29d41b48eed1bd43b20e43519d58bf987a8d96417c5ac2607c4ebefe4
|
4
|
+
data.tar.gz: 3f74b22582450a8ea680637037594a9727d5d8f2089c34409bbf20d506918eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77c191c322fa1801af116a9022055d4b698bded267e1b1639353fd08f0918b1e2eb38482a75434ce03e458da078692bb0177beb19128db70029893ad8b35d8b0
|
7
|
+
data.tar.gz: f3fd57c7d900a8f8f7e2c94281b1ac9dd7e25396b1d34c5348004dbd700c6715abd73fb8aca1f208e54050cc7b58851d327fed18ea4788a86c1ed2c5fd826f9e
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module ShelbyArena
|
2
2
|
class Client
|
3
3
|
module Fund
|
4
|
-
def list_funds
|
4
|
+
def list_funds
|
5
|
+
options = {}
|
5
6
|
options[:api_sig] = generate_api_sig(fund_path, options)
|
6
7
|
res = get(fund_path, options.sort)
|
7
8
|
Response::Fund.format(res.dig('FundListResult', 'Funds', 'Fund'))
|
@@ -4,7 +4,7 @@ module ShelbyArena
|
|
4
4
|
def list_people(options = {})
|
5
5
|
options[:api_sig] = generate_api_sig(people_path, options)
|
6
6
|
res = get(people_path, options.sort)
|
7
|
-
Response::Person.
|
7
|
+
Response::Person.format_list(res.dig('PersonListResult', 'Persons', 'Person'))
|
8
8
|
end
|
9
9
|
|
10
10
|
def find_people_by_name_and_email(first_name, last_name, email)
|
@@ -13,7 +13,12 @@ module ShelbyArena
|
|
13
13
|
}.freeze
|
14
14
|
|
15
15
|
def format_single(data)
|
16
|
-
to_h(MAP, data)
|
16
|
+
response = to_h(MAP, data)
|
17
|
+
response[:active] = to_boolean(response[:active])
|
18
|
+
response[:is_tax_deductible] = to_boolean(response[:is_tax_deductible])
|
19
|
+
response[:start_date] = date_parse(response[:start_date])
|
20
|
+
response[:end_date] = date_parse(response[:end_date])
|
21
|
+
response
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -22,13 +22,23 @@ module ShelbyArena
|
|
22
22
|
def set_email(raw_response)
|
23
23
|
# find_person returns an array of `Emails`
|
24
24
|
# list_person return `FirstActiveEmail`
|
25
|
-
|
25
|
+
emails_key = parse_emails_key(raw_response.dig('Emails', 'Email'))
|
26
|
+
|
27
|
+
raw_response.dig('FirstActiveEmail') || emails_key.first
|
26
28
|
end
|
27
29
|
|
28
30
|
def set_emails(raw_response)
|
29
31
|
# find_person returns an array of `Emails`
|
30
32
|
# list_person return `FirstActiveEmail`
|
31
|
-
raw_response.dig('Emails', 'Email')
|
33
|
+
parse_emails_key(raw_response.dig('Emails', 'Email'))
|
34
|
+
end
|
35
|
+
|
36
|
+
def parse_emails_key(emails_key)
|
37
|
+
if emails_key.is_a?(Array)
|
38
|
+
emails_key&.map { |email| email.dig('Address') } || []
|
39
|
+
else
|
40
|
+
[emails_key&.dig('Address')] || []
|
41
|
+
end
|
32
42
|
end
|
33
43
|
end
|
34
44
|
end
|
data/lib/shelby_arena/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelby_arena
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Brooks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|