ya-api-direct 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: ebb64ae11e79bffedda4ce6ae5bf6e7eb7cd488c
4
- data.tar.gz: 689f39880dc909582cafd22cb662c1d489bee15c
3
+ metadata.gz: 9f41fcfc8d138f967b885a44c1aab2eb596cb666
4
+ data.tar.gz: 4ebf9203b1bd38e056c7976f72a52a66b38360ab
5
5
  SHA512:
6
- metadata.gz: 02b61c8fc58852a3ba0b37f449e7361981581d59814169e76d27db0b974cddb5a795234f86da5102794bb23dfe67b646431c3cac8785378514f41c64449d7120
7
- data.tar.gz: 9c6e71af381828cc106ebc7d5c6ae04ed032145e0097be62a6868c4c21bf4896e5dd61781175912ed6e97a016cb01b6841da7e9fbed51411c23c6ffc544aae8e
6
+ metadata.gz: 398d24fef634c7812d844208e47ea5885db35ec0d9121f9d61982e1291169a636b5686c934528a27f99dae6e33b1f3fc6879f8a81bc821fcccb2ac61ca449d28
7
+ data.tar.gz: 54384d49276fafcd928d7d96fbd5d916728673f7e1e9f6a088e163c05de7f69b16b61184470b27fc4babeac844ed6d32962ad56209ccf979e4ae2c523dfa8893
data/README.md CHANGED
@@ -75,9 +75,9 @@ Date returned with first call of caching method is stored in ``cache_timestamp``
75
75
 
76
76
  Units data of last request is stored in ``units_data`` property. There're 3 keys in this hash:
77
77
 
78
- * ``just_used``
79
- * ``units_left``
80
- * ``units_limit``
78
+ * ``just_used`` - units used by last request.
79
+ * ``units_left`` - units left for the current session.
80
+ * ``units_limit`` - units limit for a session of your account.
81
81
 
82
82
  They were added only in Yandex Direct API 5. Calling the methods from 4 or 4 Live doesn't update them.
83
83
 
data/bin/setup CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
+ cd -
3
4
  IFS=$'\n\t'
4
5
  set -vx
5
6
 
@@ -1,11 +1,9 @@
1
- require "ya/api/direct/constants"
2
-
3
1
  module Ya::API::Direct
4
2
  class DirectServiceBase
5
3
  attr_reader :method_items, :version
6
- def initialize(client, methods)
4
+ def initialize(client, methods_data)
7
5
  @client = client
8
- @method_items = methods
6
+ @method_items = methods_data
9
7
  init_methods
10
8
  end
11
9
 
@@ -4,8 +4,8 @@ require "ya/api/direct/direct_service_base"
4
4
  module Ya::API::Direct
5
5
  class DirectServiceV4 < DirectServiceBase
6
6
 
7
- def initialize(client, methods, version = :v4)
8
- super(client, methods)
7
+ def initialize(client, methods_data, version = :v4)
8
+ super(client, methods_data)
9
9
  @version = version
10
10
  end
11
11
 
@@ -1,12 +1,11 @@
1
- require "ya/api/direct/constants"
2
1
  require "ya/api/direct/direct_service_base"
3
2
 
4
3
  module Ya::API::Direct
5
4
  class DirectServiceV5 < DirectServiceBase
6
5
  attr_reader :service, :service_url
7
6
 
8
- def initialize(client, service, methods)
9
- super(client, methods)
7
+ def initialize(client, service, methods_data)
8
+ super(client, methods_data)
10
9
  @service = service
11
10
  @service_url = service.downcase
12
11
  @version = :v5
@@ -33,7 +33,7 @@ module Ya::API::Direct
33
33
 
34
34
  def generate_header(ver)
35
35
  header = {}
36
- if ver == :v5
36
+ if [:v5].include? ver
37
37
  header.merge!({
38
38
  'Client-Login' => @config[:login],
39
39
  'Accept-Language' => @config[:locale],
@@ -1,6 +1,5 @@
1
1
  require "json"
2
2
 
3
- require "ya/api/direct/constants"
4
3
  require "ya/api/direct/exception"
5
4
 
6
5
  module Ya::API::Direct
@@ -1,7 +1,7 @@
1
1
  module Ya
2
2
  module Api
3
3
  module Direct
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ya-api-direct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - '"Rikki'