paychex 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d0c032fc4c96109c738cae58a63339e0d5ae1618933dfb14aefd68ca727a9d7
4
- data.tar.gz: 729be74e60e104634db7472e63f2ad73e8023551aebae1ba5380eee59ed34405
3
+ metadata.gz: 171053f3e759cd8a55b1ed442d838abd6ec038eeaa600c3476776dcd188af09e
4
+ data.tar.gz: 6e1057927e3c8605d8892044ef6173ba140ec5dc0732968a8a6ae824776c4bbe
5
5
  SHA512:
6
- metadata.gz: cff9b272ba0e27e3c8f61477fd5a25079449f0e3ef7dfa0fd8561a9bdcd33011afd5acfc6f3e2a2749b17a77a5d57b5148be7ee43adc4b63f292007c4aacf6c2
7
- data.tar.gz: dec6d3f0f5d1ae7fe07186f03f584c271b406563e50f2ae29dd31360b61b70e113affa117aa1a031a6eadf6f14d613a745cc6a4c7604e9ffb3e33d6bbb3bc966
6
+ metadata.gz: cd1b46a147af931d70566f1ef948ffa420e9f194e0f79e3dc8c417d2c4f746ad55d48d8d3950d482e8db9165c4fb3e3277ec7120b8ed1c0a13e9d4220989119b
7
+ data.tar.gz: 93ca764cd7bb16ecb65f2945fd824bbf6a00236051259d21e5b9eba0fbc467ab1541690cbdd37d9bfa0adb9c035f402681aceac50a8348da69ae5bc4300f7406
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paychex (0.2.2)
4
+ paychex (0.3.0)
5
5
  addressable
6
6
  faraday
7
7
  faraday_middleware
@@ -2,6 +2,7 @@ module Paychex
2
2
  class Client
3
3
  module Companies
4
4
  # Get a list of all the linked companies
5
+ # This will be unavailable once we have 200+ linked companies
5
6
  def linked_companies
6
7
  get('companies')
7
8
  end
@@ -35,8 +36,8 @@ module Paychex
35
36
 
36
37
  def details_by_display_id(display_id)
37
38
  begin
38
- content = linked_companies.body.fetch('content')
39
- company = content.find { |company| company.fetch('displayId') == display_id }
39
+ content = get("companies?displayId=#{display_id}").body.fetch('content')
40
+ company = content[0]
40
41
  return {
41
42
  "company": company,
42
43
  "message": company.nil? ? 'not-found' : 'found'
@@ -59,9 +60,9 @@ module Paychex
59
60
  def details_by_display_ids(display_ids)
60
61
  ret = {}
61
62
  begin
62
- content = linked_companies.body.fetch('content')
63
63
  display_ids.each do |display_id|
64
- company = content.find { |company| company.fetch('displayId') == display_id }
64
+ content = details_by_display_id(display_id)
65
+ company = content[:company]
65
66
  ret[display_id.to_s] = {
66
67
  "company": company,
67
68
  "message": company.nil? ? 'not-found' : 'found'
@@ -1,3 +1,3 @@
1
1
  module Paychex
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayank Dedhia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-28 00:00:00.000000000 Z
11
+ date: 2023-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler