transparent_data-rb 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: c5af41cd1106275ad10b7ca0eafa1871651d4967ba1e1a6f00d04fa826ca01b9
4
- data.tar.gz: 9d0a797a052a03d8cb57e4faba99fa094c3cc29017804d2a4f9d91e3095a5454
3
+ metadata.gz: a4a8f55fa7433e0e315d2bbb74b17105bdbb26f547e68cd3e4e869d81a98b836
4
+ data.tar.gz: 710a59a70647472ac85a443af84a6f5a1fd21b5e9d657a562625c2f5e9d82f14
5
5
  SHA512:
6
- metadata.gz: 183407be095e12dee5d5fc0fd3a6a9357f1992f08bd6375d38e109e4f0523b8b6eed3fd069984712126c3bd3c4beb2ef5aceba7ae61dc864b8806960c2a88dd7
7
- data.tar.gz: 2a7f1b56290e4a9331f32df1025acf481588cb5c7460714cb85035ac572807c43861a2aed8368ae9023c1d9a66ae56a37cfb41ed0504a26da55f4d32ac1949ed
6
+ metadata.gz: 8a93674569fbb5dddd85e95635beff0fbda36e8a3ccd380f89d27eda11c6e368bbf7b4c9fed0fab7335565c806ed1da198310860522e10fda9cde47e81a48af3
7
+ data.tar.gz: f6390304fb55dcfb2bccfe77a2f979606b3bd60d9e2efea44da569e3967192b9761498164d403c63222d933f4fde4d0d769eb4d2272ab7eb61f571d3b59c4b1f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transparent_data-rb (0.1.6)
4
+ transparent_data-rb (0.1.7)
5
5
  bundler (~> 2.1)
6
6
  faraday
7
7
  rake (~> 13.0)
@@ -4,12 +4,11 @@ require 'json'
4
4
  require 'transparent_data/version'
5
5
  require 'transparent_data/exceptions'
6
6
  require 'transparent_data/configurable'
7
- require 'transparent_data/request'
8
- require 'transparent_data/module_functions'
7
+ require 'transparent_data/actions'
9
8
 
10
9
  module TransparentData
11
10
  extend TransparentData::Configurable
12
- extend TransparentData::ModuleFunctions
11
+ extend TransparentData::Actions
13
12
 
14
13
  initialize_config_accessors(:url, :user, :password, :key)
15
14
  end
@@ -4,7 +4,7 @@ require 'transparent_data/actions/add'
4
4
  require 'transparent_data/actions/result'
5
5
 
6
6
  module TransparentData
7
- module ModuleFunctions
7
+ module Actions
8
8
  def search(country, query_str)
9
9
  TransparentData::Actions::Search.new(client, country, query_str).call
10
10
  end
@@ -2,24 +2,26 @@ require 'transparent_data/response/struct'
2
2
 
3
3
  module TransparentData
4
4
  class Request
5
- def self.call(client, method, query: {}, json: {})
6
- response = client.post(build_path(method, query), json)
5
+ class << self
6
+ def call(client, method, query: {}, json: {})
7
+ response = client.post(build_path(method, query), json.to_json)
7
8
 
8
- TransparentData::Response::Struct.new(response)
9
- end
9
+ TransparentData::Response::Struct.new(response)
10
+ end
10
11
 
11
- private
12
+ private
12
13
 
13
- def build_path(method, query)
14
- base_path = "/#{TransparentData.key}/#{method}"
14
+ def build_path(method, query)
15
+ base_path = "/#{TransparentData.key}/#{method}"
15
16
 
16
- return base_path unless query&.any?
17
+ return base_path unless query&.any?
17
18
 
18
- base_path.concat("?#{convert_params_to_query(query)}")
19
- end
19
+ base_path.concat("?#{convert_params_to_query(query)}")
20
+ end
20
21
 
21
- def convert_params_to_query(params)
22
- params.map { |pair| pair.join('=') }.join('&')
22
+ def convert_params_to_query(params)
23
+ params.map { |pair| pair.join('=') }.join('&')
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -1,3 +1,3 @@
1
1
  module TransparentData
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transparent_data-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kakorin
@@ -114,12 +114,12 @@ files:
114
114
  - bin/console
115
115
  - bin/setup
116
116
  - lib/transparent_data.rb
117
+ - lib/transparent_data/actions.rb
117
118
  - lib/transparent_data/actions/add.rb
118
119
  - lib/transparent_data/actions/result.rb
119
120
  - lib/transparent_data/actions/search.rb
120
121
  - lib/transparent_data/configurable.rb
121
122
  - lib/transparent_data/exceptions.rb
122
- - lib/transparent_data/module_functions.rb
123
123
  - lib/transparent_data/request.rb
124
124
  - lib/transparent_data/response/struct.rb
125
125
  - lib/transparent_data/version.rb