admitad 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 662b14152ba647f89b5b5785991dbee8bb42df30f58ddffb40e1197a82060943
4
- data.tar.gz: 4d5cae39828274b7e1bf3b454c30a2adb0098a2f20e7590134b21c5ae6f80694
3
+ metadata.gz: fc49232aeb0813288dae2f1d5e22fca62a66865185730669e50f1523cd28128f
4
+ data.tar.gz: 20b5ad4b961a0f9ce37f2720c7b9b56f4f81e007c1cacc1265d185cff4557b2d
5
5
  SHA512:
6
- metadata.gz: 021b2d9c7d401d574536f73679b8829bde52df8fd83ff11c012ed8cc56904dba02539c92aeae4e30bfe28a39ad5647a00613214780b0a3f40e32399a82a8845c
7
- data.tar.gz: a509451b45d69fea5312d83ae495ac2e1ea0aba9813c0cbb4d74ba5578bea21081ab2978420a25722e2297ed37a9dcb46bcc6d664d69e5662481dbd2af462406
6
+ metadata.gz: 577abf5631d3a7bc592f65845ec80de16ec56a4424cb66c8f04893b010b4e152b8ce8dc411fb055478fa173cc8f724cd96cbec3b6911cc8627ed3e9818134d99
7
+ data.tar.gz: 95fbc8d49228f16f343323a07c39b9395b0a8419ffc0212744da1c7598411c917f342d12224c4586b21a928011dc33e828998fcea4bc30b661c6c584945f1375
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- admitad (0.0.7)
4
+ admitad (0.0.10)
5
5
  activesupport (>= 4.2)
6
6
  httparty (~> 0.16.2)
7
7
  virtus (~> 1.0, >= 1.0.5)
@@ -22,17 +22,21 @@ GEM
22
22
  coderay (1.1.2)
23
23
  coercible (1.0.0)
24
24
  descendants_tracker (~> 0.0.1)
25
- concurrent-ruby (1.0.5)
25
+ concurrent-ruby (1.1.3)
26
26
  descendants_tracker (0.0.4)
27
27
  thread_safe (~> 0.3, >= 0.3.1)
28
28
  diff-lcs (1.3)
29
29
  equalizer (0.0.11)
30
- httparty (0.16.2)
30
+ httparty (0.16.3)
31
+ mime-types (~> 3.0)
31
32
  multi_xml (>= 0.5.2)
32
- i18n (1.1.0)
33
+ i18n (1.1.1)
33
34
  concurrent-ruby (~> 1.0)
34
35
  ice_nine (0.11.2)
35
36
  method_source (0.9.0)
37
+ mime-types (3.2.2)
38
+ mime-types-data (~> 3.2015)
39
+ mime-types-data (3.2018.0812)
36
40
  minitest (5.11.3)
37
41
  multi_xml (0.6.0)
38
42
  parallel (1.12.1)
@@ -88,4 +92,4 @@ DEPENDENCIES
88
92
  rubocop (~> 0.49.0)
89
93
 
90
94
  BUNDLED WITH
91
- 1.16.4
95
+ 1.16.6
@@ -22,6 +22,7 @@ module Admitad
22
22
  AdSpace = AdSpaces::AdSpace
23
23
  AffiliateProgram = AffiliatePrograms::AffiliateProgram
24
24
  Coupon = Coupons::Coupon
25
+ Currency = Currencies::Currency
25
26
  end
26
27
 
27
28
  AdmitadAPI = Admitad
@@ -88,6 +88,14 @@ module Admitad
88
88
  get('/categories/', query: params.slice(*Constants::BASE_PARAMS))
89
89
  end
90
90
 
91
+ def currencies(**params)
92
+ get('/currencies/', query: params.slice(*Constants::BASE_PARAMS))
93
+ end
94
+
95
+ def currencies_rate(**params)
96
+ get('/currencies/rate/', query: params.slice(:base, :target, :date))
97
+ end
98
+
91
99
  private
92
100
 
93
101
  def post(path, options = {}, &block)
@@ -0,0 +1,41 @@
1
+ module Admitad
2
+ module Currencies
3
+ class Currency < Success
4
+ attribute :code, String
5
+ attribute :min_sum, String
6
+ attribute :name, String
7
+ attribute :sign, String
8
+
9
+ class << self
10
+ def where(**params)
11
+ Response.create(Wrapper.currencies(params))
12
+ end
13
+
14
+ def all
15
+ where
16
+ end
17
+ end
18
+ end
19
+
20
+ class Rate < Success
21
+ attribute :base, String
22
+ attribute :target, String
23
+ attribute :date, String
24
+ attribute :rate, String
25
+
26
+ class << self
27
+ def find(**params)
28
+ create(Wrapper.currencies_rate(params))
29
+ end
30
+ end
31
+ end
32
+
33
+ class Response < Success
34
+ attribute :results, Array[Currency]
35
+ attribute :_meta, Hash
36
+
37
+ alias currencies results
38
+ alias metadata _meta
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,3 @@
1
1
  module Admitad
2
- VERSION = '0.0.9'.freeze
2
+ VERSION = '0.0.10'.freeze
3
3
  end
@@ -6,7 +6,7 @@ module Admitad
6
6
  :categories, :ad_spaces_where, :find_ad_space_by_id, :coupons, :find_coupon,
7
7
  :affiliate_programs_where, :affiliate_programs_for_ad_space,
8
8
  :connect_affiliate_program, :disconnect_affiliate_program, :find_coupon_for_website,
9
- :coupons_for_website,
9
+ :coupons_for_website, :currencies, :currencies_rate,
10
10
  to: :instance
11
11
  end
12
12
 
@@ -61,6 +61,16 @@ module Admitad
61
61
  client.categories(params)
62
62
  end
63
63
 
64
+ def currencies(**params)
65
+ check_token
66
+ client.currencies(params)
67
+ end
68
+
69
+ def currencies_rate(**params)
70
+ check_token
71
+ client.currencies_rate(params)
72
+ end
73
+
64
74
  def ad_spaces_where(**params)
65
75
  check_token
66
76
  client.websites(params)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admitad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexandr-senyuk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-08 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -159,6 +159,7 @@ files:
159
159
  - lib/admitad/models/affiliate_program_response.rb
160
160
  - lib/admitad/models/category.rb
161
161
  - lib/admitad/models/coupons_response.rb
162
+ - lib/admitad/models/currencies_response.rb
162
163
  - lib/admitad/models/deeplinks.rb
163
164
  - lib/admitad/models/regions.rb
164
165
  - lib/admitad/models/result.rb