paylocity_web_service 0.2.0 → 0.2.1

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: 61c37a8407a937d427a0977f672e8a1cedb242aca0699641756595c377bc4ef6
4
- data.tar.gz: 6dcbab6fdd29651035fc331d9df52db0dc2f71a50bef1d6c2cdaa83045e6b721
3
+ metadata.gz: 33f09a98ae188a34663ec0cebb9f794cf7047fd30450554c96e9bc96aa4f878b
4
+ data.tar.gz: 1463dad0fec22d676864f791b4526ea2e696d1741d462435a1b3648525243dbf
5
5
  SHA512:
6
- metadata.gz: b6d40b77bcb8c7745e6db01ba7cf96f6c3318df04bf8fc592267a5934ba14d1e55d189cc7832e48ca87681edd1cbb4a33e74a1fdf4abf8aa1805761d76b363f3
7
- data.tar.gz: bf2a545e9a90521fced8f9676288a230ef31efbcb301b9fa80327566e4e1f3b33f05014a7e93de3d9e580390b751b16fbb44235bf4fd0748e0abb53e2f4252ec
6
+ metadata.gz: b1e62adc3cf74ac566588e02874a2ca991a204266fbedaa2c4cf20d5098ac653c40ee66b2af1eecd1849db2b07ba324d57a58d0a38d1ff9bf8ad732d6c5aa27e
7
+ data.tar.gz: 1f14ab469633028556a3c58714c15acf4c64d6e7e63b91d5479e11a8421d496cf4dee75d98a0a5c881e359b14d1d2ae5844b76f053b01dd869b48df86fbc3ee7
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gemspec
8
8
  # The following gems are required for local development and will not be included by `gem install mygem` or `bundle add mygem`.
9
9
  group :development, :test do
10
10
  gem 'awesome_print', require: 'ap'
11
- gem 'pry-byebug'
11
+ gem 'pry'
12
12
  gem 'rubocop'
13
13
  gem 'rake'
14
14
  gem 'bundler'
@@ -10,7 +10,7 @@ module PaylocityWebService
10
10
  end
11
11
 
12
12
  def self.write(key, value, expires_in = 3600 )
13
- expires_at = (Time.now.to_i + expires_in) - 60
13
+ expires_at = (Time.now.to_i + expires_in.to_i) - 60
14
14
  store[key] = { value: value, expires_at: expires_at}
15
15
  end
16
16
 
@@ -1,16 +1,16 @@
1
1
  module PaylocityWebService
2
2
  class Client
3
3
  module Companies
4
- CodeResources = %W(costcenter1 costcenter2 costcenter3 deductions earnings taxes paygrade positions)
4
+ CodeResources = %W(costCenter1 costCenter2 costCenter3 deductions earnings taxes paygrade positions)
5
5
 
6
6
  def company_schema
7
7
  get("/api/v2/companies/#{company_id}/openapi")
8
8
  end
9
9
 
10
10
  # Available Code Resources:
11
- # - costcenter1
12
- # - costcenter2
13
- # - costcenter3
11
+ # - costCenter1
12
+ # - costCenter2
13
+ # - costCenter3
14
14
  # - deductions
15
15
  # - earnings
16
16
  # - taxes
@@ -23,6 +23,15 @@ module PaylocityWebService
23
23
  def code_resources
24
24
  CodeResources
25
25
  end
26
+
27
+ # Paylocity hasn't provide a way to check the connectivity of the API, we have to fire a request to check it.
28
+ def company_connected?
29
+ return true if company_codes('costCenter1').status == 200
30
+ return true if company_schema.code == 200
31
+ false
32
+ rescue => e
33
+ false
34
+ end
26
35
  end
27
36
  end
28
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaylocityWebService
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paylocity_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Lv
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-29 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday