Skip to content

Commit c7c7d4c

Browse files
authored
Add Updated Title Roles to Autocomplete (#24)
* add support for utr in autocomplete * add test * update test * fix
1 parent 4e4d677 commit c7c7d4c

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://i.imgur.com/S7DkZtr.png" width="250" alt="People Data Labs Logo">
2+
<img src="https://www.peopledatalabs.com/images/company-logo.png" style="background-color: white; padding: 5px 10px;" width="250" alt="People Data Labs Logo">
33
</p>
44
<h1 align="center">People Data Labs Ruby Library</h1>
55
<p align="center">Official Ruby client for the People Data Labs API.</p>

lib/peopledatalabs/api_resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class APIResource
33

44
protected
55

6-
VALID_AUTOCOMPLETE_FIELDS = ['company', 'country', 'industry', 'location', 'major', 'region', 'role', 'school', 'sub_role', 'skill', 'title'].freeze
6+
VALID_AUTOCOMPLETE_FIELDS = ['class', 'company', 'country', 'industry', 'location', 'major', 'region', 'role', 'school', 'sub_role', 'skill', 'title'].freeze
77

88
def self.get(path:, headers: {}, params: {})
99
request = check(params: params, path: path)

lib/peopledatalabs/resources/autocomplete.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
module Peopledatalabs
44
class Autocomplete < APIResource
5-
def self.retrieve(field:, text: '', size: 10, pretty: false, titlecase: false)
5+
def self.retrieve(field:, text: '', size: 10, pretty: false, titlecase: false, updated_title_roles: false)
66

77
params = {
88
'field' => field,
99
'text' => text,
1010
'size' => size,
1111
'pretty' => pretty,
1212
'titlecase' => titlecase,
13+
'updated_title_roles' => updated_title_roles,
1314
};
1415

1516
headers = {

lib/peopledatalabs/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Peopledatalabs
2-
VERSION = "3.1.0"
2+
VERSION = "3.2.0"
33
end

spec/peopledatalabs_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@
219219
expect(result).to be_an_instance_of(Hash)
220220
end
221221

222+
it "should return autocomplete record for class" do
223+
result = Peopledatalabs::Autocomplete.retrieve(field: 'class', text: 'sales', size: 10, updated_title_roles: true)
224+
expect(result['status']).to eq(200)
225+
expect(result).to be_an_instance_of(Hash)
226+
end
227+
222228
it "should error" do
223229
result = Peopledatalabs::Autocomplete.retrieve(field: nil)
224230
expect(result['status']).to eq(400)

0 commit comments

Comments
 (0)