cantook 0.0.7 → 0.0.8

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: dc9e3e5ab141c6dd12b032bc26adaa7903cc5afc
4
- data.tar.gz: 9682afbcfe474443d03e803b01279e1a4226f728
3
+ metadata.gz: 8d16980052d06739dc662fed100a80edec647240
4
+ data.tar.gz: 21dbc29d2e39ebedeb215d981afd3b05adffcb66
5
5
  SHA512:
6
- metadata.gz: 30fa186dfc9e314f265326df501ef4d371c506df63c3ae596cc81d73c885472877643e96453a9e6abfc8e042f7a9c080e8c77d728a43fc9af1404038426077b8
7
- data.tar.gz: e4bb747eee7384ec99629c24777bdf406f5dfc6224f0ab0725675b9920748bfe81d26032599c7ccbfae27597d8644b587dde240d85e4b53d700b8bec45758dbb
6
+ metadata.gz: cceaa2e604de1d9d11b77eb55b60d32ee61c95754cbd774367a717212b7a8fde31c176b099355d0c38716923f27acd9137b0a2229ddef0fd8e6cf57c534f58bc
7
+ data.tar.gz: 8163fde9ea70d8e944fb5a11ce6eebe1b30121bcf22e8d312fa9e8553c156c003d4e4a6568793bd005843f89f042829ff14c9fe918175efe30656fd3a722a590
data/lib/cantook/base.rb CHANGED
@@ -12,6 +12,8 @@ module Cantook
12
12
  # organisation_id Yes Your merchant number. This number is provided upon registration.
13
13
  # isbn Yes The publication's ISBN.
14
14
  # format Yes The publication's format (pdf/epub/mobi).
15
+ # currency Yes
16
+ # country Yes
15
17
 
16
18
  attr_accessor :base_url,
17
19
  :auth,
@@ -36,6 +38,7 @@ module Cantook
36
38
  # @option params [String] :format - format of the publication being sold, eg 'epub' or 'mobi'
37
39
  # @option params [String] :sale_state - use 'test' for test/development, nil for production (real sales)
38
40
  # @option params [String] :currency - 3-letter ISO-4217 code
41
+ # @option params [String] :counrtry - ISO 3166-1 Alpha-3 (can, fra, ita) or Alpha-2 (CA, FR, IT) formats.
39
42
  def initialize(params = {})
40
43
  @username = params[:username]
41
44
  @password = params[:password]
@@ -52,13 +55,16 @@ module Cantook
52
55
 
53
56
  # @return [Hash] A basic hash of options common to all Cantook requests
54
57
  def base_options
58
+ Rails.logger.info "COUNTRY: #{country}, SELF COUNTRY #{self.country}"
55
59
  { format: format, isbn: isbn, sale_state: sale_state, currency: currency, country: country }
56
60
  end
57
61
  private :base_options
58
62
 
59
63
  # @param [Hash] options
60
64
  def get_request options
65
+ Rails.logger.info "BASE OPTIONS: #{base_options.inspect}"
61
66
  self.query = options.merge(base_options)
67
+ Rails.logger.info "self query: #{self.query.inspect}"
62
68
  HTTParty.get(request_url, query: query, basic_auth: auth)
63
69
  end
64
70
  private :get_request
@@ -1,3 +1,3 @@
1
1
  module Cantook
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cantook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gordon B. Isnor