blockscore 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3f88083287f1df3355f32db522587267dbf1497
4
- data.tar.gz: b9cae6b6eaaa8385a159af1804e1c2af33b5cb9a
3
+ metadata.gz: e88b157232ca06038bc84c1ac5b2a396faa9653f
4
+ data.tar.gz: 3a3298c56a4aeccead937ab406797257e057a4b0
5
5
  SHA512:
6
- metadata.gz: c11985da2b727c576b8fa15fa716a4c676be5f4de5806dda35cfa77db431693533a09305593d922d9fbc4b376646553f4c44d208ea910a2aa9913172fda2bb51
7
- data.tar.gz: 70d0be292789f0b3f0d1b666dc3b7a62fd71bb6b52b1e769114401e8317724da3344954f6cdc19aacf2be2d1ef0a72ff7217c3a9907e3ef5feac0ff7450026f5
6
+ metadata.gz: 059eeb15b132025b08fe50e95ecf554af98f2fd781025123eb7c1fb654493028037ea96886f3ac2e76895e8135c32bba03b11ae65d29e02c72466d82e4a4ca93
7
+ data.tar.gz: f20a55a0e6a8d49819398d0bbcc6c83ddf65052fb61f58a6fb5a0442bf74e9a73e11d2725d549ca56e1124555fefbf6ae61fe0c84948b5e1b8c28d69b53e6df5
data/Gemfile CHANGED
@@ -5,9 +5,11 @@ gem 'httparty', '~> 0.11'
5
5
  # Add dependencies to develop your gem here.
6
6
  # Include everything needed to run rake, tests, features, etc.
7
7
  group :development do
8
- gem "shoulda", "~> 3.1.0"
8
+ gem "shoulda", "~> 3.5.0"
9
9
  gem "rdoc", "~> 3.12"
10
10
  gem "bundler", "~> 1.0"
11
11
  gem "jeweler", "~> 2.0.1"
12
12
  gem "simplecov", ">= 0"
13
+ gem "minitest", "~> 4.0"
14
+ gem 'shoulda-context', '~> 1.2'
13
15
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # blockscore-ruby
2
2
 
3
- This is the official library for Ruby clients of the BlockScore API. [Click here to read the full documentation including code examples](http://docs.blockscore.com/v3.0/ruby/).
3
+ This is the official library for Ruby clients of the BlockScore API. [Click here to read the full documentation including code examples](http://docs.blockscore.com/v4.0/ruby/).
4
4
 
5
5
  ## Install
6
6
 
@@ -13,7 +13,7 @@ gem install blockscore
13
13
  If you are using Rails, add the following to your `Gemfile`:
14
14
 
15
15
  ```ruby
16
- gem 'blockscore', '~> 3.0.0'
16
+ gem 'blockscore', '~> 4.0.0'
17
17
  ```
18
18
 
19
19
  ## Getting Started
@@ -21,10 +21,10 @@ gem 'blockscore', '~> 3.0.0'
21
21
  To get started, you can initialize the library with one line:
22
22
 
23
23
  ```ruby
24
- client = BlockScore::Client.new('your-api-key', version = 3)
24
+ client = BlockScore::Client.new('your-api-key')
25
25
  ```
26
26
 
27
- To see the list of calls you can make, please visit out [full Ruby API reference](http://docs.blockscore.com/ruby).
27
+ To see the list of calls you can make, please visit out [full Ruby API reference](http://docs.blockscore.com/4.0/ruby).
28
28
 
29
29
  ## Exceptions and Errors
30
30
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 4.0.0
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: blockscore 3.0.1 ruby lib
5
+ # stub: blockscore 4.0.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "blockscore"
9
- s.version = "3.0.1"
9
+ s.version = "4.0.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Alain Meier"]
14
- s.date = "2014-10-22"
14
+ s.date = "2014-11-17"
15
15
  s.description = "A ruby client library for the BlockScore API."
16
16
  s.email = "alain@blockscore.com"
17
17
  s.extra_rdoc_files = [
@@ -28,8 +28,9 @@ Gem::Specification.new do |s|
28
28
  "blockscore-ruby.sublime-project",
29
29
  "blockscore.gemspec",
30
30
  "lib/blockscore.rb",
31
+ "lib/blockscore/candidates.rb",
31
32
  "lib/blockscore/client.rb",
32
- "lib/blockscore/company.rb",
33
+ "lib/blockscore/companies.rb",
33
34
  "lib/blockscore/error/authorization_error.rb",
34
35
  "lib/blockscore/error/blockscore_error.rb",
35
36
  "lib/blockscore/error/error_handler.rb",
@@ -38,10 +39,9 @@ Gem::Specification.new do |s|
38
39
  "lib/blockscore/error/parameter_error.rb",
39
40
  "lib/blockscore/error/validation_error.rb",
40
41
  "lib/blockscore/errors.rb",
41
- "lib/blockscore/question_set.rb",
42
- "lib/blockscore/verification.rb",
43
- "lib/blockscore/watchlist.rb",
44
- "lib/blockscore/watchlist_candidate.rb",
42
+ "lib/blockscore/people.rb",
43
+ "lib/blockscore/question_sets.rb",
44
+ "lib/blockscore/watchlists.rb",
45
45
  "test/helper.rb",
46
46
  "test/test_blockscore.rb"
47
47
  ]
@@ -55,26 +55,32 @@ Gem::Specification.new do |s|
55
55
 
56
56
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
57
  s.add_runtime_dependency(%q<httparty>, ["~> 0.11"])
58
- s.add_development_dependency(%q<shoulda>, ["~> 3.1.0"])
58
+ s.add_development_dependency(%q<shoulda>, ["~> 3.5.0"])
59
59
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
60
60
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
61
61
  s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
62
62
  s.add_development_dependency(%q<simplecov>, [">= 0"])
63
+ s.add_development_dependency(%q<minitest>, ["~> 4.0"])
64
+ s.add_development_dependency(%q<shoulda-context>, ["~> 1.2"])
63
65
  else
64
66
  s.add_dependency(%q<httparty>, ["~> 0.11"])
65
- s.add_dependency(%q<shoulda>, ["~> 3.1.0"])
67
+ s.add_dependency(%q<shoulda>, ["~> 3.5.0"])
66
68
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
67
69
  s.add_dependency(%q<bundler>, ["~> 1.0"])
68
70
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
69
71
  s.add_dependency(%q<simplecov>, [">= 0"])
72
+ s.add_dependency(%q<minitest>, ["~> 4.0"])
73
+ s.add_dependency(%q<shoulda-context>, ["~> 1.2"])
70
74
  end
71
75
  else
72
76
  s.add_dependency(%q<httparty>, ["~> 0.11"])
73
- s.add_dependency(%q<shoulda>, ["~> 3.1.0"])
77
+ s.add_dependency(%q<shoulda>, ["~> 3.5.0"])
74
78
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
75
79
  s.add_dependency(%q<bundler>, ["~> 1.0"])
76
80
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
77
81
  s.add_dependency(%q<simplecov>, [">= 0"])
82
+ s.add_dependency(%q<minitest>, ["~> 4.0"])
83
+ s.add_dependency(%q<shoulda-context>, ["~> 1.2"])
78
84
  end
79
85
  end
80
86
 
@@ -0,0 +1,49 @@
1
+ module BlockScore
2
+ class Candidates
3
+ PATH = '/candidates'
4
+
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # POST https://api.blockscore.com/candidates
10
+ def create(options = {})
11
+ response = @client.post PATH, options
12
+ end
13
+
14
+ # PATCH https://api.blockscore.com/candidates/{CANDIDATE_ID}
15
+ def edit(candidate_id, options = {})
16
+ response = @client.put "#{PATH}/#{candidate_id}", options
17
+ end
18
+
19
+ # DELETE https://api.blockscore.com/candidates/{CANDIDATE_ID}
20
+ def delete(candidate_id)
21
+ response = @client.delete "#{PATH}/#{candidate_id}"
22
+ end
23
+
24
+ # GET https://api.blockscore.com/candidates/{CANDIDATE_ID}
25
+ def retrieve(candidate_id)
26
+ response = @client.get "#{PATH}/#{candidate_id}"
27
+ end
28
+
29
+ # GET https://api.blockscore.com/candidates
30
+ def all(count = nil, offset = nil, options = {})
31
+ body = (options.include? :body) ? options[:body] : {}
32
+
33
+ body[:count] = count
34
+ body[:offset] = offset
35
+
36
+ @client.get PATH, body
37
+ end
38
+
39
+ # GET https://api.blockscore.com/candidates/:id/history
40
+ def history(candidate_id)
41
+ response = @client.get "#{PATH}/#{candidate_id}/history"
42
+ end
43
+
44
+ # GET https://api.blockscore.com/candidates/:id/hits
45
+ def hits(candidate_id)
46
+ response = @client.get "#{PATH}/#{candidate_id}/hits"
47
+ end
48
+ end
49
+ end
@@ -2,20 +2,23 @@ module BlockScore
2
2
  class Client
3
3
  include HTTParty
4
4
 
5
- attr_reader :verification, :question_set, :company, :watchlist_candidate, :watchlist
5
+ attr_reader :people, :question_sets, :companies, :candidates, :watchlists
6
6
 
7
- def initialize(api_key, version, options = {})
7
+ def initialize(api_key, options = {})
8
8
  @api_key = api_key
9
9
  @auth = { :username => @api_key, :password => "" }
10
- @verification = BlockScore::Verification.new(self)
11
- @question_set = BlockScore::QuestionSet.new(self)
12
- @company = BlockScore::Company.new(self)
13
- @watchlist_candidate = BlockScore::WatchlistCandidate.new(self)
14
- @watchlist = BlockScore::Watchlist.new(self)
10
+ @people = BlockScore::People.new(self)
11
+ @question_sets = BlockScore::QuestionSets.new(self)
12
+ @companies = BlockScore::Companies.new(self)
13
+ @candidates = BlockScore::Candidates.new(self)
14
+ @watchlists = BlockScore::Watchlists.new(self)
15
15
  @error_handler = BlockScore::ErrorHandler.new
16
16
 
17
17
  options[:base_uri] ||= "https://api.blockscore.com"
18
- options[:headers] = { 'Accept' => 'application/vnd.blockscore+json;version=' + version.to_s }
18
+ options[:headers] = {
19
+ 'Accept' => 'application/vnd.blockscore+json;version=4',
20
+ 'User-Agent' => 'blockscore-ruby/4.0.0 (https://github.com/BlockScore/blockscore-ruby)'
21
+ }
19
22
 
20
23
  options.each do |k,v|
21
24
  self.class.send k, v
@@ -1,5 +1,6 @@
1
1
  module BlockScore
2
- class Company
2
+ class Companies
3
+ PATH = '/companies'
3
4
 
4
5
  def initialize(client)
5
6
  @client = client
@@ -9,7 +10,7 @@ module BlockScore
9
10
  # /companies POST
10
11
  #
11
12
  def create(options = {})
12
- response = @client.post '/companies', options
13
+ response = @client.post PATH, options
13
14
  end
14
15
 
15
16
  #
@@ -17,7 +18,7 @@ module BlockScore
17
18
  #
18
19
  def retrieve(id, options = {})
19
20
  body = (options.include? :query) ? options[:body] : {}
20
- response = @client.get "/companies/#{id.to_s}", body
21
+ response = @client.get "#{PATH}/#{id.to_s}", body
21
22
  end
22
23
 
23
24
  #
@@ -29,7 +30,7 @@ module BlockScore
29
30
  body[:count] = count
30
31
  body[:offset] = offset
31
32
 
32
- @client.get '/companies', body
33
+ @client.get PATH, body
33
34
  end
34
35
  end
35
36
  end
@@ -0,0 +1,37 @@
1
+ module BlockScore
2
+ class People
3
+ PATH = '/people'
4
+
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ #
10
+ # /people POST
11
+ #
12
+ def create(options = {})
13
+ response = @client.post PATH, options
14
+ end
15
+
16
+ #
17
+ # /people/:id GET
18
+ #
19
+ # id - ID of the person to retrieve.
20
+ def retrieve(id, options = {})
21
+ body = (options.include? :query) ? options[:body] : {}
22
+ response = @client.get "#{PATH}/#{id.to_s}", body
23
+ end
24
+
25
+ #
26
+ # '/people' GET
27
+ #
28
+ def all(count = nil, offset = nil, options = {})
29
+ body = (options.include? :body) ? options[:body] : {}
30
+
31
+ body[:count] = count
32
+ body[:offset] = offset
33
+
34
+ @client.get PATH, body
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,49 @@
1
+ module BlockScore
2
+ class QuestionSets
3
+ PATH = '/question_sets'
4
+
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ def create(person_id, options = {})
10
+ body = (options.include? :body) ? options[:body] : {}
11
+ body[:person_id] = person_id
12
+
13
+ response = @client.post PATH, body
14
+ end
15
+
16
+ #
17
+ # '/question_sets/:id/score' POST
18
+ #
19
+ # answers -
20
+ def score(id, answers)
21
+ body = {}
22
+ body[:answers] = answers
23
+
24
+ response = @client.post "#{PATH}/#{id.to_s}/score", body
25
+ end
26
+
27
+ #
28
+ # /question_sets/:id GET
29
+ #
30
+ # id -
31
+ def retrieve(id)
32
+ body = Hash.new
33
+
34
+ response = @client.get "#{PATH}/#{id.to_s}", body
35
+ end
36
+
37
+ #
38
+ # '/question_sets' GET
39
+ #
40
+ def all(count = nil, offset = nil, options = {})
41
+ body = (options.include? :body) ? options[:body] : {}
42
+
43
+ body[:count] = count
44
+ body[:offset] = offset
45
+
46
+ @client.get PATH, body
47
+ end
48
+ end
49
+ end
@@ -1,15 +1,18 @@
1
1
  module BlockScore
2
- class Watchlist
2
+ class Watchlists
3
+ PATH = '/watchlists'
4
+
3
5
  def initialize(client)
4
6
  @client = client
5
7
  end
8
+
6
9
  # POST https://api.blockscore.com/watchlists
7
- def search(watchlist_candidate_id, match_type = nil)
10
+ def search(candidate_id, match_type = nil)
8
11
  body = {}
9
- body[:watchlist_candidate_id] = watchlist_candidate_id
12
+ body[:candidate_id] = candidate_id
10
13
  body[:match_type] = match_type
11
14
 
12
- @client.post '/watchlists', body
15
+ @client.post PATH, body
13
16
  end
14
17
  end
15
18
  end
@@ -1,4 +1,7 @@
1
1
  require 'simplecov'
2
+ require 'minitest/autorun'
3
+ require 'shoulda'
4
+ # require 'shoulda_context'
2
5
 
3
6
  module SimpleCov::Configuration
4
7
  def clean_filters
@@ -31,4 +34,4 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
31
34
  require 'blockscore'
32
35
 
33
36
  class Test::Unit::TestCase
34
- end
37
+ end
@@ -2,26 +2,25 @@ require File.join(File.dirname(__FILE__), 'helper')
2
2
 
3
3
  class TestBlockScore < Test::Unit::TestCase
4
4
  # If you'd like to run the test suite, fill in your API key,
5
- # a verification ID, a question set ID, a company ID, and a watchlist candidate ID below.
6
- @version = 3
5
+ # a person ID, a question set ID, a company ID, and a candidate ID below.
7
6
  @api_key = ""
8
7
 
9
- @@verification_id = ""
8
+ @@person_id = ""
10
9
  @@question_set_id = ""
11
10
  @@company_id = ""
12
- @@watchlist_candidate_id = ""
11
+ @@candidate_id = ""
13
12
 
14
- @@client = BlockScore::Client.new(@api_key, version = @version)
13
+ @@client = BlockScore::Client.new(@api_key)
15
14
 
16
15
  context "a watchlist" do
17
16
  should "return search watchlists" do
18
- response = @@client.watchlist.search(@@watchlist_candidate_id)
17
+ response = @@client.watchlists.search(@@candidate_id)
19
18
  assert_equal 200, response.code
20
19
  end
21
20
  end
22
21
 
23
- context "a watchlist candidate" do
24
- should "return create a watchlist candidate" do
22
+ context "a candidate" do
23
+ should "return create a candidate" do
25
24
  watchlist_params = {
26
25
  :note => "12341234",
27
26
  :ssn => "0001",
@@ -33,41 +32,41 @@ class TestBlockScore < Test::Unit::TestCase
33
32
  :address_city => "Cupertino",
34
33
  :address_country_code => "US"
35
34
  }
36
- response = @@client.watchlist_candidate.create(watchlist_params)
35
+ response = @@client.candidates.create(watchlist_params)
37
36
  assert_equal 201, response.code
38
37
  end
39
38
 
40
- should "return edit a watchlist candidate" do
39
+ should "return edit a candidate" do
41
40
  watchlist_params = {
42
41
  :date_of_birth => "1945-05-08",
43
42
  :name_middle => "Jones"
44
43
  }
45
- response = @@client.watchlist_candidate.edit(@@watchlist_candidate_id, watchlist_params)
44
+ response = @@client.candidates.edit(@@candidate_id, watchlist_params)
46
45
  assert_equal 200, response.code
47
46
  end
48
47
 
49
- should "return retrieve a watchlist candidate" do
50
- response = @@client.watchlist_candidate.retrieve(@@watchlist_candidate_id)
48
+ should "return retrieve a candidate" do
49
+ response = @@client.candidates.retrieve(@@candidate_id)
51
50
  assert_equal 200, response.code
52
51
  end
53
52
 
54
- should "return a list of wachlist candidates" do
55
- response = @@client.watchlist_candidate.all
53
+ should "return a list of candidates" do
54
+ response = @@client.candidates.all
56
55
  assert_equal 200, response.code
57
56
  end
58
57
 
59
- should "return a history of a wachlist candidate" do
60
- response = @@client.watchlist_candidate.history(@@watchlist_candidate_id)
58
+ should "return a history of a candidate" do
59
+ response = @@client.candidates.history(@@candidate_id)
61
60
  assert_equal 200, response.code
62
61
  end
63
62
 
64
- should "return the hits of a wachlist candidate" do
65
- response = @@client.watchlist_candidate.hits(@@watchlist_candidate_id)
63
+ should "return the hits of a candidate" do
64
+ response = @@client.candidates.hits(@@candidate_id)
66
65
  assert_equal 200, response.code
67
66
  end
68
67
 
69
- should "return delete a watchlist candidate" do
70
- response = @@client.watchlist_candidate.delete(@@watchlist_candidate_id)
68
+ should "return delete a candidate" do
69
+ response = @@client.candidates.delete(@@candidate_id)
71
70
  assert_equal 200, response.code
72
71
  end
73
72
 
@@ -75,22 +74,22 @@ class TestBlockScore < Test::Unit::TestCase
75
74
 
76
75
  context "a company" do
77
76
  should "return a list of companies" do
78
- response = @@client.company.all
77
+ response = @@client.companies.all
79
78
  assert_equal 200, response.code
80
79
  end
81
80
 
82
81
  should "return count = 2 companies" do
83
- response = @@client.company.all(count = 2)
82
+ response = @@client.companies.all(count = 2)
84
83
  assert_equal 200, response.code
85
84
  end
86
85
 
87
86
  should "return count=2 offset=2 companies" do
88
- response = @@client.company.all(count = 2, offset = 2)
87
+ response = @@client.companies.all(count = 2, offset = 2)
89
88
  assert_equal 200, response.code
90
89
  end
91
90
 
92
91
  should "return a single company" do
93
- response = @@client.company.retrieve(@@company_id)
92
+ response = @@client.companies.retrieve(@@company_id)
94
93
  assert_equal 200, response.code
95
94
  end
96
95
 
@@ -98,75 +97,72 @@ class TestBlockScore < Test::Unit::TestCase
98
97
  company_params = {
99
98
  :entity_name => "BlockScore",
100
99
  :tax_id => "123410000",
101
- :incorp_date => "1980-08-25",
102
- :incorp_state => "DE",
103
- :incorp_country_code => "US",
104
- :incorp_type => "corporation",
100
+ :incorporation_day => 25,
101
+ :incorporation_month => 8,
102
+ :incorporation_year => 1980,
103
+ :incorporation_state => "DE",
104
+ :incorporation_country_code => "US",
105
+ :incorporation_type => "corporation",
105
106
  :dbas => "BitRemit",
106
107
  :registration_number => "123123123",
107
108
  :email => "test@example.com",
108
109
  :url => "https://blockscore.com",
109
110
  :phone_number => "6505555555",
110
111
  :ip_address => "67.160.8.182",
111
- :address => {
112
- :street1 => "1 Infinite Loop",
113
- :street2 => nil,
114
- :city => "Cupertino",
115
- :state => "CA",
116
- :postal_code => "95014",
117
- :country_code => "US"
118
- }
112
+ :address_street1 => "1 Infinite Loop",
113
+ :address_street2 => nil,
114
+ :address_city => "Cupertino",
115
+ :address_subdivision => "CA",
116
+ :address_postal_code => "95014",
117
+ :address_country_code => "US"
119
118
  }
120
119
 
121
- response = @@client.company.create(company_params)
120
+ response = @@client.companies.create(company_params)
122
121
 
123
122
  assert_equal 201, response.code
124
123
  end
125
124
  end
126
125
 
127
- context "a verification" do
128
- should "return a list of verifications" do
129
- response = @@client.verification.all
126
+ context "a person" do
127
+ should "return a list of people" do
128
+ response = @@client.people.all
130
129
  assert_equal 200, response.code
131
130
  end
132
131
 
133
- should "return count = 2 verifications" do
134
- response = @@client.verification.all(count = 2)
132
+ should "return count = 2 people" do
133
+ response = @@client.people.all(count = 2)
135
134
  assert_equal 200, response.code
136
135
  end
137
136
 
138
- should "return count=2 offset=2 verifications" do
139
- response = @@client.verification.all(count = 2, offset = 2)
137
+ should "return count=2 offset=2 people" do
138
+ response = @@client.people.all(count = 2, offset = 2)
140
139
  assert_equal 200, response.code
141
140
  end
142
141
 
143
- should "return a single verification" do
144
- response = @@client.verification.retrieve(@@verification_id)
142
+ should "return a single person" do
143
+ response = @@client.people.retrieve(@@person_id)
145
144
  assert_equal 200, response.code
146
145
  end
147
146
 
148
- should "return create a verification" do
149
- verification_params = {
150
- :date_of_birth => "1975-01-01",
151
- :identification => {
152
- :ssn => "0000"
153
- },
154
- :name => {
155
- :first => "John",
156
- :middle => "P",
157
- :last => "Doe"
158
- },
159
- :address => {
160
- :street1 => "1 Infinite Loop",
161
- :street2 => nil,
162
- :city => "Cupertino",
163
- :state => "CA",
164
- :postal_code => "95014",
165
- :country_code => "US"
166
- }
147
+ should "return create a person" do
148
+ people_params = {
149
+ :birth_day => 1,
150
+ :birth_month => 1,
151
+ :birth_year => 1975,
152
+ :document_type => "ssn",
153
+ :document_value => "0000",
154
+ :name_first => "John",
155
+ :name_middle => "P",
156
+ :name_last => "Doe",
157
+ :address_street1 => "1 Infinite Loop",
158
+ :address_street2 => nil,
159
+ :address_city => "Cupertino",
160
+ :address_subdivision => "CA",
161
+ :address_postal_code => "95014",
162
+ :address_country_code => "US"
167
163
  }
168
164
 
169
- response = @@client.verification.create(verification_params)
165
+ response = @@client.people.create(people_params)
170
166
 
171
167
  assert_equal 201, response.code
172
168
  end
@@ -174,27 +170,27 @@ class TestBlockScore < Test::Unit::TestCase
174
170
 
175
171
  context "a question set" do
176
172
  should "return create a question set" do
177
- response = @@client.question_set.create(@@verification_id)
173
+ response = @@client.question_sets.create(@@person_id)
178
174
  assert_equal 201, response.code
179
175
  end
180
176
 
181
177
  should "return a single question set" do
182
- response = @@client.question_set.retrieve(@@question_set_id)
178
+ response = @@client.question_sets.retrieve(@@question_set_id)
183
179
  assert_equal 200, response.code
184
180
  end
185
181
 
186
182
  should "return a list of question sets" do
187
- response = @@client.question_set.all
183
+ response = @@client.question_sets.all
188
184
  assert_equal 200, response.code
189
185
  end
190
186
 
191
187
  should "return count = 2" do
192
- response = @@client.question_set.all(count = 2)
188
+ response = @@client.question_sets.all(count = 2)
193
189
  assert_equal 200, response.code
194
190
  end
195
191
 
196
192
  should "return count = 2 offset = 2" do
197
- response = @@client.question_set.all(count = 2, offset = 2)
193
+ response = @@client.question_sets.all(count = 2, offset = 2)
198
194
  assert_equal 200, response.code
199
195
  end
200
196
 
@@ -222,7 +218,7 @@ class TestBlockScore < Test::Unit::TestCase
222
218
  }
223
219
  ]
224
220
 
225
- response = @@client.question_set.score(@@question_set_id, @answers)
221
+ response = @@client.question_sets.score(@@question_set_id, @answers)
226
222
 
227
223
  assert_equal 201, response.code
228
224
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alain Meier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: 3.5.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: 3.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,34 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: shoulda-context
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.2'
97
125
  description: A ruby client library for the BlockScore API.
98
126
  email: alain@blockscore.com
99
127
  executables: []
@@ -111,8 +139,9 @@ files:
111
139
  - blockscore-ruby.sublime-project
112
140
  - blockscore.gemspec
113
141
  - lib/blockscore.rb
142
+ - lib/blockscore/candidates.rb
114
143
  - lib/blockscore/client.rb
115
- - lib/blockscore/company.rb
144
+ - lib/blockscore/companies.rb
116
145
  - lib/blockscore/error/authorization_error.rb
117
146
  - lib/blockscore/error/blockscore_error.rb
118
147
  - lib/blockscore/error/error_handler.rb
@@ -121,10 +150,9 @@ files:
121
150
  - lib/blockscore/error/parameter_error.rb
122
151
  - lib/blockscore/error/validation_error.rb
123
152
  - lib/blockscore/errors.rb
124
- - lib/blockscore/question_set.rb
125
- - lib/blockscore/verification.rb
126
- - lib/blockscore/watchlist.rb
127
- - lib/blockscore/watchlist_candidate.rb
153
+ - lib/blockscore/people.rb
154
+ - lib/blockscore/question_sets.rb
155
+ - lib/blockscore/watchlists.rb
128
156
  - test/helper.rb
129
157
  - test/test_blockscore.rb
130
158
  homepage: http://github.com/blockscore/blockscore-ruby
@@ -1,49 +0,0 @@
1
- module BlockScore
2
- class QuestionSet
3
-
4
- def initialize(client)
5
- @client = client
6
- end
7
-
8
- def create(verification_id, options = {})
9
- body = (options.include? :body) ? options[:body] : {}
10
- body[:verification_id] = verification_id
11
-
12
- response = @client.post '/questions', body
13
- end
14
-
15
- #
16
- # '/questions/:id/score' POST
17
- #
18
- # answers -
19
- def score(id, answers)
20
- body = {}
21
- body[:answers] = answers
22
-
23
- response = @client.post "/questions/#{id.to_s}/score", body
24
- end
25
-
26
- #
27
- # /questions/:id GET
28
- #
29
- # question_set_id -
30
- # verification_id -
31
- def retrieve(id)
32
- body = Hash.new
33
-
34
- response = @client.get "/questions/#{id.to_s}", body
35
- end
36
-
37
- #
38
- # '/questions' GET
39
- #
40
- def all(count = nil, offset = nil, options = {})
41
- body = (options.include? :body) ? options[:body] : {}
42
-
43
- body[:count] = count
44
- body[:offset] = offset
45
-
46
- @client.get '/questions', body
47
- end
48
- end
49
- end
@@ -1,36 +0,0 @@
1
- module BlockScore
2
- class Verification
3
-
4
- def initialize(client)
5
- @client = client
6
- end
7
-
8
- #
9
- # /verifications POST
10
- #
11
- def create(options = {})
12
- response = @client.post '/verifications', options
13
- end
14
-
15
- #
16
- # /verifications/:id GET
17
- #
18
- # id -
19
- def retrieve(id, options = {})
20
- body = (options.include? :query) ? options[:body] : {}
21
- response = @client.get "/verifications/#{id.to_s}", body
22
- end
23
-
24
- #
25
- # '/verifications' GET
26
- #
27
- def all(count = nil, offset = nil, options = {})
28
- body = (options.include? :body) ? options[:body] : {}
29
-
30
- body[:count] = count
31
- body[:offset] = offset
32
-
33
- @client.get '/verifications', body
34
- end
35
- end
36
- end
@@ -1,47 +0,0 @@
1
- module BlockScore
2
- class WatchlistCandidate
3
- def initialize(client)
4
- @client = client
5
- end
6
-
7
- # POST https://api.blockscore.com/watchlist_candidates
8
- def create(options = {})
9
- response = @client.post '/watchlist_candidates', options
10
- end
11
-
12
- # PATCH https://api.blockscore.com/watchlist_candidates/{WATCHLIST_CANDIDATE_ID}
13
- def edit(watchlist_candidate_id, options = {})
14
- response = @client.put "/watchlist_candidates/#{watchlist_candidate_id}", options
15
- end
16
-
17
- # DELETE https://api.blockscore.com/watchlist_candidates/{WATCHLIST_CANDIDATE_ID}
18
- def delete(watchlist_candidate_id)
19
- response = @client.delete "/watchlist_candidates/#{watchlist_candidate_id}"
20
- end
21
-
22
- # GET https://api.blockscore.com/watchlist_candidates/{WATCHLIST_CANDIDATE_ID}
23
- def retrieve(watchlist_candidate_id)
24
- response = @client.get "/watchlist_candidates/#{watchlist_candidate_id}"
25
- end
26
-
27
- # GET https://api.blockscore.com/watchlist_candidates
28
- def all(count = nil, offset = nil, options = {})
29
- body = (options.include? :body) ? options[:body] : {}
30
-
31
- body[:count] = count
32
- body[:offset] = offset
33
-
34
- @client.get '/watchlist_candidates', body
35
- end
36
-
37
- # GET https://api.blockscore.com/watchlist_candidates/:id/history
38
- def history(watchlist_candidate_id)
39
- response = @client.get "/watchlist_candidates/#{watchlist_candidate_id}/history"
40
- end
41
-
42
- # GET https://api.blockscore.com/watchlist_candidates/:id/hits
43
- def hits(watchlist_candidate_id)
44
- response = @client.get "/watchlist_candidates/#{watchlist_candidate_id}/hits"
45
- end
46
- end
47
- end