transparent_data-rb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -22
- data/lib/transparent_data/request.rb +1 -1
- data/lib/transparent_data/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f258721c6c110c19f04edf8539c83c69848db272da6198e0c64938cb5d14caf5
|
4
|
+
data.tar.gz: 7b43d915c95b584c2d0e2b79956bf0f390dd509b800208a57f1c070ef4cd98aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d3c2a4abfaceb3fad5f1f9430ecf3172459cab72fe7f5ff1711706a7d7f848341f9eebe133eb3033a92ca6361bc4205b2b5f8ac0649da2b49f9b5c04333a87f
|
7
|
+
data.tar.gz: 24fe0d76d0e496fba62722ac6ac65bb9f9898c047df4edb3143f0897ffe4740426ecb4c8c4f90f00d66b9e6d9833e1c46d2c080cf4b120d65282ddf1eaeb4d2b
|
data/README.md
CHANGED
@@ -1,44 +1,58 @@
|
|
1
|
-
#
|
1
|
+
# PG Inheritance
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/transparent_data-rb.svg)](https://badge.fury.io/rb/transparent_data-rb) [![Build Status](https://travis-ci.com/sigmen/transparent_data-rb.svg?branch=master)](https://travis-ci.com/sigmen/transparent_data-rb)
|
2
3
|
|
3
|
-
|
4
|
+
# UNDER DEVELOPMENT
|
4
5
|
|
5
|
-
|
6
|
+
## Supports
|
7
|
+
|
8
|
+
Ruby `>= 2.4`.
|
6
9
|
|
7
10
|
## Installation
|
8
11
|
|
9
12
|
Add this line to your application's Gemfile:
|
10
13
|
|
11
|
-
|
12
|
-
gem 'transparent_data-rb'
|
13
|
-
```
|
14
|
+
gem 'transparent_data-rb'
|
14
15
|
|
15
16
|
And then execute:
|
16
17
|
|
17
18
|
$ bundle install
|
18
19
|
|
19
|
-
Or install
|
20
|
+
Or install with:
|
20
21
|
|
21
22
|
$ gem install transparent_data-rb
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
24
|
+
### Usage
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
## Contributing
|
26
|
+
```ruby
|
27
|
+
response = TransparentData.search(country_name, query)
|
34
28
|
|
35
|
-
|
29
|
+
response.body # => [{...}]
|
30
|
+
response.status # => 200
|
31
|
+
response.headers # => {...}
|
32
|
+
```
|
36
33
|
|
34
|
+
#### Search options
|
35
|
+
* country_name - Any available country name (see Available countries)
|
36
|
+
* query - Search query
|
37
37
|
|
38
|
-
|
38
|
+
#### Available countries
|
39
|
+
Gem supports all available Transparentdata.eu countries:
|
40
|
+
* finland
|
41
|
+
* uk
|
42
|
+
* denmark
|
43
|
+
* norway
|
44
|
+
* slovakia
|
45
|
+
* czech
|
39
46
|
|
40
|
-
|
47
|
+
#### Configuration
|
41
48
|
|
42
|
-
|
49
|
+
Before using gem you need to configure some parameters:
|
43
50
|
|
44
|
-
|
51
|
+
```ruby
|
52
|
+
TransparentData.configure do |config|
|
53
|
+
config.url = 'https://transparentdata.eu/' # You can using any another url for test environment
|
54
|
+
config.user = 'user' # Username for HTTP Basic
|
55
|
+
config.password = 'password' # Password for HTTP Basic
|
56
|
+
config.key = 'key' # API Key
|
57
|
+
end
|
58
|
+
```
|
@@ -26,7 +26,7 @@ module TransparentData
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def fetch_country_id(country)
|
29
|
-
COUNTRY_TO_KEY_MAP.fetch(country.to_sym) do
|
29
|
+
COUNTRY_TO_KEY_MAP.fetch(country.to_s.downcase.to_sym) do
|
30
30
|
raise TransparentData::UnknownCountryError, "Unknown country: #{country.inspect}"
|
31
31
|
end
|
32
32
|
end
|