api_proxy 0.2.3 → 0.2.4

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: 1d1ac2a1d2b57c66377b1e28d0ae1ab5c0cceff203eae7d23f089df9f5a4b1e2
4
- data.tar.gz: 5d03d9c8643879f8d145b63c5704f37e96e9e78564e3b74944edf7f74c9f650a
3
+ metadata.gz: 4acf429f00bd4f21e26be48a06d25779105a8e1b4c273f277f8f0aa02ef4f149
4
+ data.tar.gz: b21eff23b34c8f9853de56e5f9b3b596bad320ac7993254dc85549222c366cf4
5
5
  SHA512:
6
- metadata.gz: dfded3b838256acfa4ac94f12ff4d437992accc9fa0bae0248fe5891d366a810d91b585188ba3aeaeaaa58abb4982c97e1b33753fadc66466b71cbd75186d09d
7
- data.tar.gz: '08ae6bbb9c9ee7c71929dca3a3b944bdf32ff972a91d379ed86e86f842bd075dd323294fe355eff22958c499e61ea44542fa56e35644aa77b83dcabb1163e559'
6
+ metadata.gz: ed26b41bf56975a1eeda45abb4e36309c35e419cb6adf2ac29a9b4cbdd0c7feed899b8c87aa62b98dade566d97df48ade5a1f20cfa99ae3264c5d7e1ba39bb82
7
+ data.tar.gz: b0b44756095ab46be7696277f4a29d3fa3b163323bdd534aba9fbb4f733d65148a41e5689e100f017ccfe1beb78bc952a98b0a62999b95e497fd28ef25df4bda
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_proxy (0.2.3)
4
+ api_proxy (0.2.4)
5
5
  activesupport (>= 4.0)
6
6
  api_signature (~> 0.1.2)
7
7
  httparty (>= 0.15)
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApiProxy
4
+ class Client
5
+ def initialize(options = {})
6
+ @options = { namespace: :default }.merge(options)
7
+ end
8
+
9
+ [:get, :post, :patch, :put, :delete].each do |type|
10
+ define_method type do |path, options = {}|
11
+ perform_request(type, path, options)
12
+ end
13
+ end
14
+
15
+ private
16
+
17
+ def perform_request(type, path, options)
18
+ options = @options.merge(options)
19
+
20
+ config = ApiProxy.configuration(options[:namespace])
21
+ url = File.join(config.api_url, path)
22
+
23
+ ApiProxy::SignedRequest.new(type, url, options).perform
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApiProxy
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Malinovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -214,6 +214,7 @@ files:
214
214
  - bin/console
215
215
  - bin/setup
216
216
  - lib/api_proxy.rb
217
+ - lib/api_proxy/client.rb
217
218
  - lib/api_proxy/config.rb
218
219
  - lib/api_proxy/headers_filter.rb
219
220
  - lib/api_proxy/middleware.rb