paychex_api 0.0.5 → 0.0.6

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: 26445528480bff4925df351a175a69bc283f73f628c5175dbe00e027cb791ab5
4
- data.tar.gz: 062d617c2cb719806e45c96f861c1c2090fff9a31a0065a40a87ccd1a701a6f5
3
+ metadata.gz: fc00ec5a8405825185829380f0df8d122a491f61a867bcbb3b726197cace5fa8
4
+ data.tar.gz: acd90fb4babca071be0b146aff187da6fbe8c10f2c958d9fb5fc9c92f945d420
5
5
  SHA512:
6
- metadata.gz: b8f0e6534f085b51c2f0a8ff6616c1f60383e8448591e084c0236c4ce7afc3628c2dc9da92e8bb266f4c17fb6cda09d89a19f2ab5ace77701a40d9d6f45ee8b5
7
- data.tar.gz: eeb98d3f9749faccbeed4558b4ff8772609b66778f101d9070cd399af8fad603632ec77ed1e8cbd20e70dbba2e4667a91a8a0cdc0e958ef1c22781d031d35302
6
+ metadata.gz: 2358dff6c297109a76ae2718b3cf6cfe435eb55e0106f4163114f92e143c343a59f0b43727d5fddb04803731bfcb3a4b44157ee10771793292f4c54f6bf2bf7a
7
+ data.tar.gz: 2a4a3dfa007b7af1435ef604562253da7d105fa083e8efe2e33760cf18d3e0288485099479f47883a6f388c3e919d9e88ec274090e9acb80b4a00bcb24c3e053
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paychex_api (0.0.4)
4
+ paychex_api (0.0.5)
5
5
  faraday (~> 0.9.2)
6
6
  faraday_middleware (~> 0.9.2)
7
7
  footrest (>= 0.5.1)
@@ -8,8 +8,8 @@ module PaychexAPI
8
8
  @next_page = nil
9
9
  @prev_page = nil
10
10
 
11
- attr_reader :status, :headers, :members, :links, :metadata, :errors
12
- attr_writer :next_page
11
+ attr_reader :status, :headers, :links, :metadata, :errors
12
+ attr_writer :next_page, :members
13
13
 
14
14
  def self.process_response(response, api_client)
15
15
  ApiArray.new(response, api_client)
@@ -28,20 +28,24 @@ module PaychexAPI
28
28
  end
29
29
  end
30
30
 
31
+ def members
32
+ @members || []
33
+ end
34
+
31
35
  def length
32
- @members.length
36
+ members.length
33
37
  end
34
38
 
35
39
  def [](index)
36
- @members[index]
40
+ members[index]
37
41
  end
38
42
 
39
43
  def last
40
- @members.last
44
+ members.last
41
45
  end
42
46
 
43
47
  def each
44
- @members.each { |member| yield(member) }
48
+ members.each { |member| yield(member) }
45
49
  end
46
50
 
47
51
  def pages?
@@ -53,12 +57,12 @@ module PaychexAPI
53
57
  end
54
58
 
55
59
  def each_page
56
- yield(@members, @linked, @meta)
60
+ yield(members, @linked, @meta)
57
61
  while @next_page
58
62
  response = get_page(@next_page)
59
63
  apply_response_metadata(response, false)
60
64
  @members = get_response_content(response)
61
- yield(@members, @linked, @meta)
65
+ yield(members, @linked, @meta)
62
66
  end
63
67
  @link_hash = {}
64
68
  end
@@ -1,3 +1,3 @@
1
1
  module PaychexAPI
2
- VERSION = '0.0.5'.freeze unless defined?(PaychexAPI::VERSION)
2
+ VERSION = '0.0.6'.freeze unless defined?(PaychexAPI::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer