dadata_ru 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/dadata_ru.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4dfaeaa3f9d136ef9984571bae083ad67e79c2f
|
4
|
+
data.tar.gz: f3d588da690b9f93537845dd81475a87fad19cf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e45ae8e2396d4ab65cc1652171149bf5e38243593b4b5766b458ea644957ed634785845f3cc17f96738dd1f50986319bbea4d5dc2e881a4d335b7448ca2a875
|
7
|
+
data.tar.gz: 5cb6b2786dd9883ddca806fad70bbab46664beb21a92e08b6129dc03ffa7604d8200d45c84b6a8c2e7207f522508e1c8577fbc8ca75db93b6dca4479e97cc6f0
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ gem 'dadata_ru'
|
|
15
15
|
### Usage:
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
require '
|
18
|
+
require 'dadata_ru'
|
19
19
|
|
20
20
|
DadataRu.configure do |config|
|
21
21
|
config.url = "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address"
|
@@ -23,7 +23,10 @@ DadataRu.configure do |config|
|
|
23
23
|
end
|
24
24
|
|
25
25
|
api = DadataRu::Address.new
|
26
|
-
req = api.call(
|
26
|
+
req = api.call({
|
27
|
+
query: 'Невский 48',
|
28
|
+
count: 15
|
29
|
+
})
|
27
30
|
puts req.status
|
28
31
|
puts req.result["suggestions"]
|
29
32
|
|
data/lib/dadata_ru.rb
CHANGED
@@ -47,7 +47,7 @@ module DadataRu
|
|
47
47
|
ERRORS[code]
|
48
48
|
end
|
49
49
|
|
50
|
-
def call
|
50
|
+
def call params
|
51
51
|
submit(
|
52
52
|
url: DadataRu.config.url,
|
53
53
|
headers: {
|
@@ -55,7 +55,7 @@ module DadataRu
|
|
55
55
|
"Accept": "application/json"},
|
56
56
|
method: 'POST',
|
57
57
|
type: 'json',
|
58
|
-
body:
|
58
|
+
body: params.to_json
|
59
59
|
)
|
60
60
|
end
|
61
61
|
|