data-com-api 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -1
- data/lib/data-com-api/client.rb +1 -1
- data/lib/data-com-api/responses/search_company.rb +8 -0
- data/lib/data-com-api/version.rb +1 -1
- data/spec/models/client_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTE1ZTQ2N2ZjN2NmZWIwNjEzMDE5YzcyZGMwZWFjOWNjMDZkY2UyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjVkZGQ2NjEyZmNjOTY5NjI5Nzk0NTIxOWFmYzY1ZmE2OGFkODQxMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWIwMTQyZTE5YmFmOTViMDQ2OTBmMTZmOGZlMWUyNjc2OWEwNDQ3MmM0N2Vi
|
10
|
+
YWRlNmU0NDQyMGZhNTA1NGIzODVjMTAxMmY0ZTYxMzRjNzhiMmE2ODE4YjA2
|
11
|
+
Y2U5ZGQyZTVjNmE3OTIzYTFjZjhhMjZlMDA1NTliNzEyNjZjZDk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODIzNzMxNWVhZThlNzgzZTcyNGI4NDdmZjhlMWY2YTI4OWEwM2FkYzQwZGJm
|
14
|
+
MjgyN2I0NmYxN2NkNTBjODEzNDY3ODgzOGFjZTg5NDQzMjRmMGEwZjM0NTE4
|
15
|
+
ZDcyOWYyZDhmM2FjNTNiZmZiZmRlMDIxOGNiODNhOTQ2MzEyYTY=
|
data/README.md
CHANGED
@@ -27,7 +27,9 @@ client = DataComApi::Client.new('your-api-token')
|
|
27
27
|
You can then configure the client in the following way:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
|
30
|
+
# Value must be between 1 and 500, 100 will be used if search_company is used
|
31
|
+
# and supplied value is greater than 100
|
32
|
+
client.page_size = 100
|
31
33
|
```
|
32
34
|
|
33
35
|
You can also get the totals API calls performed on the client with:
|
data/lib/data-com-api/client.rb
CHANGED
@@ -6,6 +6,14 @@ module DataComApi
|
|
6
6
|
module Responses
|
7
7
|
class SearchCompany < SearchBase
|
8
8
|
|
9
|
+
MAX_PAGE_SIZE = 100
|
10
|
+
|
11
|
+
def initialize(api_client, received_options)
|
12
|
+
super
|
13
|
+
|
14
|
+
@page_size = MAX_PAGE_SIZE if @page_size > MAX_PAGE_SIZE
|
15
|
+
end
|
16
|
+
|
9
17
|
protected
|
10
18
|
|
11
19
|
def transform_request(request)
|
data/lib/data-com-api/version.rb
CHANGED
data/spec/models/client_spec.rb
CHANGED
@@ -36,12 +36,12 @@ describe DataComApi::Client do
|
|
36
36
|
|
37
37
|
describe "#page_size=" do
|
38
38
|
|
39
|
-
it "accepts values between 1 and
|
40
|
-
expect{client.page_size = Random.rand(
|
39
|
+
it "accepts values between 1 and 500" do
|
40
|
+
expect{client.page_size = Random.rand(500) + 1}.not_to raise_error
|
41
41
|
end
|
42
42
|
|
43
|
-
it "doesn't accept values >
|
44
|
-
expect{client.page_size =
|
43
|
+
it "doesn't accept values > 500" do
|
44
|
+
expect{client.page_size = 501}.to raise_error DataComApi::ParamError
|
45
45
|
end
|
46
46
|
|
47
47
|
it "doesn't accept values < 1" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data-com-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fire-Dragon-DoL
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|