shelby_arena 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 6e8fd72eb3fa12747e89e9d971b40f72ff0d126e6ce7fb818a9b6ffb729755c6
4
- data.tar.gz: 5079761d76b407b6b1e4fa887fdf63abb6ede3ff5b2a695abbbe5eceed33ade1
3
+ metadata.gz: f7c3a359d351954ae3f2aa74a9c71b01c7aaf5dcb976463032a76b434d42c6d5
4
+ data.tar.gz: 0bc07eccedb05822ee4be620e58b6031f6bd28d895bfad3bf071d8f52485f7fd
5
5
  SHA512:
6
- metadata.gz: 17e681850dac47c0dcb42574502b6e7de41e60c838cb4ab8521fbbb475b66b3e33541242caba9b7dd134d5143b5ba91512abe7209202256ad5e72e456b9de0c2
7
- data.tar.gz: eb764b5758d79f21016f7478ace6dbca0de34fba04ac85c07a1d5967bd1895550de520c5784dbe8eae8d380b7dcdcf80b8653bc19633a87898b4246c43ce0077
6
+ metadata.gz: 6474347ea7f7abd2b9f13ea7bde94199d28f34d409ea41fb63ebbf42a82979fb115d36daaff909815eb70300f1d25257e78f224891e157136a93f136c2ad40ad
7
+ data.tar.gz: a23547ea3746dc0af2c348b4b49e3191f43e9d2eac8aa39c94930e7a79a7c51b1354acf231745058741e370643612b5f1b918e168616c522e6517d47f9bc307b
@@ -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.format(res.dig('PersonListResult', 'Persons', '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)
@@ -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
- raw_response.dig('FirstActiveEmail') || raw_response.dig('Emails', 'Email', 0, 'Address')
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')&.map { |email| email.dig('Address') } || []
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
@@ -1,3 +1,3 @@
1
1
  module ShelbyArena
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelby_arena
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks