checkr-official 1.0.2 → 1.1.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
  SHA1:
3
- metadata.gz: 0fd54e3b5798dd838beb31c43bc7b3a4da619cf2
4
- data.tar.gz: bf941cf26a026ee573504678a247571a61001644
3
+ metadata.gz: 3e492068573125488bc43d5a3e849788959233e7
4
+ data.tar.gz: aede787f0b0dfe934d2407a8f3fffd9c114dfd04
5
5
  SHA512:
6
- metadata.gz: 19fe187497cd058cdf766ed3f2ad6aefd9f8a3e2908946b36003648690925e430a939e8ad1f4308ad2c57bb7c91be78fad8fb8a2e525d5a80356bc8d646dcecc
7
- data.tar.gz: 80ed601d77f401b45b0bb179874e2f1e8d9b235952639df7964bc0c237879e93b11c2b0cd135b2fb08b6a48adbb78b9c0069556dade90ca3fe0346a13aaa5e82
6
+ metadata.gz: bde325ad92092d6e50140acfc7e4114a34f34069e765a9c50c4c12d5a4018d7ca51e8fcf8a8bf2c7f077d1832c3d79198da0145c11fbe6431ea0b28d929d878c
7
+ data.tar.gz: f85ea6f213e030804e357652a0b7ef50c35efdac80ba14fc3508d91f4bcbb43b8e2485d1d5e28c0561b2f85d3e79323d78cc907d357e1a90f1f224d585981ce3
data/Changelog.md ADDED
@@ -0,0 +1,23 @@
1
+ ## 1.1.0 (2016-03-03)
2
+
3
+ Features:
4
+
5
+ - Adds Candidate#save method (@squaresurf, #6)
6
+
7
+ ## 1.0.2 (2015-03-24)
8
+
9
+ Fixes:
10
+
11
+ - Fixed a bug - #4 - with Util.constantize
12
+
13
+ ## 1.0.1 (2015-03-24)
14
+
15
+ Features:
16
+
17
+ - Updated documents class to feel like other classes
18
+
19
+ ## 1.0 (2015-03-04)
20
+
21
+ Features:
22
+
23
+ - Initial release
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Checkr Ruby bindings ![Travis CI Status](https://travis-ci.org/checkr/checkr-ruby.svg?branch=master) [![Code Climate](https://codeclimate.com/github/checkr/checkr-ruby/badges/gpa.svg)](https://codeclimate.com/github/checkr/checkr-ruby)
1
+ # Checkr Ruby bindings [![Build Status](https://travis-ci.org/checkr/checkr-ruby.svg?branch=master)](https://travis-ci.org/checkr/checkr-ruby) [![Code Climate](https://codeclimate.com/github/checkr/checkr-ruby/badges/gpa.svg)](https://codeclimate.com/github/checkr/checkr-ruby)
2
2
 
3
3
 
4
4
  ## Installation
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'bump/tasks'
1
2
  require 'rake/testtask'
2
3
  require './tasks/api_test.rb'
3
4
 
@@ -17,8 +17,9 @@ spec = Gem::Specification.new do |s|
17
17
 
18
18
  s.add_development_dependency('mocha', '~> 0.13.2')
19
19
  s.add_development_dependency('shoulda', '~> 3.4.0')
20
+ s.add_development_dependency('bump', '0.5.2')
21
+ s.add_development_dependency('rake', '10.4.2')
20
22
  s.add_development_dependency('test-unit')
21
- s.add_development_dependency('rake')
22
23
 
23
24
  s.files = `git ls-files`.split("\n")
24
25
  s.test_files = `git ls-files -- test/*`.split("\n")
@@ -26,6 +26,8 @@ module Checkr
26
26
  api_class_method :create, :post
27
27
  api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
28
28
 
29
+ api_instance_method :save, :post, :default_params => :changed_attributes
30
+
29
31
  def self.path
30
32
  "/v1/candidates"
31
33
  end
@@ -1,3 +1,3 @@
1
1
  module Checkr
2
- VERSION = File.open(File.expand_path("../../../VERSION", __FILE__)).read()
2
+ VERSION = '1.1.0'.freeze
3
3
  end
data/samples/candidate.md CHANGED
@@ -139,6 +139,57 @@ candidate = Checkr::Candidate.retrieve("e44aa283528e6fde7d542194")
139
139
  ```
140
140
 
141
141
 
142
+ ## Update an existing Candidate
143
+
144
+ ### Definition
145
+
146
+ ```ruby
147
+ candidate = Checkr::Candidate.retrieve({CANDIDATE_ID})
148
+ candidate.copy_requested = {BOOL}
149
+ candidate.save
150
+ ```
151
+
152
+ ### Example Request
153
+
154
+ ```ruby
155
+ require 'checkr' # Note the gem is named checkr-official
156
+ Checkr.api_key = "83ebeabdec09f6670863766f792ead24d61fe3f9"
157
+
158
+ candidate = Checkr::Candidate.retrieve("e44aa283528e6fde7d542194")
159
+ candidate.copy_requested = true
160
+ candidate.save
161
+ ```
162
+
163
+ ### Example Response
164
+
165
+ ```ruby
166
+ #<Checkr::Candidate:0x3fd909a22584 id=e44aa283528e6fde7d542194> JSON: {
167
+ "first_name": "John",
168
+ "middle_name": "Alfred",
169
+ "last_name": "Smith",
170
+ "email": "john.smith@gmail.com",
171
+ "phone": null,
172
+ "zipcode": "90401",
173
+ "dob": "1970-01-22",
174
+ "ssn": "XXX-XX-4645",
175
+ "driver_license_number": "F211165",
176
+ "driver_license_state": "CA",
177
+ "previous_driver_license_number": null,
178
+ "previous_driver_license_state": null,
179
+ "copy_requested": true,
180
+ "custom_id": null,
181
+ "reports": {"object":"list","data":[{"id":"4722c07dd9a10c3985ae432a"}, ...]},
182
+ "geos": {"object":"list","data":[]},
183
+ "adjudication": null,
184
+ "documents": {"object":"list","data":[]},
185
+ "id": "e44aa283528e6fde7d542194",
186
+ "object": "test_candidate",
187
+ "uri": "/v1/candidates/e44aa283528e6fde7d542194",
188
+ "created_at": "2014-06-17T05:55:47Z"
189
+ }
190
+ ```
191
+
192
+
142
193
  ## List existing Candidates
143
194
 
144
195
  ### Definition
@@ -41,6 +41,19 @@ module Checkr
41
41
  assert_equal(test_candidate[:email], candidate.email)
42
42
  end
43
43
 
44
+ should 'be updateable' do
45
+ candidate = Candidate.new(test_candidate)
46
+ candidate.copy_requested = true
47
+
48
+ @mock.expects(:post).once.with do |url, headers, params|
49
+ params == candidate.changed_attributes && url == "#{@candidate_url}/#{candidate.id}"
50
+ end.returns(test_response(test_candidate))
51
+
52
+ # This should update this instance with test_candidate since it was returned
53
+ candidate.save
54
+ assert_equal(test_candidate[:copy_requested], candidate.copy_requested)
55
+ end
56
+
44
57
  should 'include an empty documents list' do
45
58
  # TODO(joncalhoun): Implement this when test docs are available.
46
59
 
@@ -1,6 +1,10 @@
1
1
  require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
+ class TestObj; end
4
+
3
5
  module Checkr
6
+ class TestObj; end
7
+
4
8
  class UtilTest < Test::Unit::TestCase
5
9
  should "symbolize_keys should convert keys to symbols" do
6
10
  start = {
@@ -46,5 +50,10 @@ module Checkr
46
50
 
47
51
  assert_equal(finish, Util.query_array(start))
48
52
  end
53
+
54
+ should 'scope the class in the Checkr namespace' do
55
+ assert_not_equal(::TestObj, Util.constantize(:TestObj))
56
+ assert_equal(Checkr::TestObj, Util.constantize(:TestObj))
57
+ end
49
58
  end
50
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkr-official
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -87,21 +87,35 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: 3.4.0
89
89
  - !ruby/object:Gem::Dependency
90
- name: test-unit
90
+ name: bump
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
95
+ version: 0.5.2
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: '0'
102
+ version: 0.5.2
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rake
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: 10.4.2
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '='
115
+ - !ruby/object:Gem::Version
116
+ version: 10.4.2
117
+ - !ruby/object:Gem::Dependency
118
+ name: test-unit
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - ">="
@@ -125,11 +139,10 @@ extra_rdoc_files: []
125
139
  files:
126
140
  - ".gitignore"
127
141
  - ".travis.yml"
142
+ - Changelog.md
128
143
  - Gemfile
129
- - History.txt
130
144
  - README.md
131
145
  - Rakefile
132
- - VERSION
133
146
  - bin/checkr-console
134
147
  - checkr-official.gemspec
135
148
  - gemfiles/default-with-activesupport.gemfile
@@ -216,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
229
  version: '0'
217
230
  requirements: []
218
231
  rubyforge_project:
219
- rubygems_version: 2.2.2
232
+ rubygems_version: 2.4.5.1
220
233
  signing_key:
221
234
  specification_version: 4
222
235
  summary: Ruby bindings for Checkr API
data/History.txt DELETED
@@ -1,12 +0,0 @@
1
- === 1.0.2 2015-03-24
2
- * 1 minor enchancement:
3
- * Fixed a bug with Util.constantize
4
-
5
- === 1.0.1 2015-03-24
6
- * 1 minor enchancement:
7
- * Updated documents class to feel like other classes.
8
-
9
- === 1.0 2015-03-04
10
-
11
- * 1 major enhancement:
12
- * Initial release
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.2