cantook 0.0.8 → 0.0.9

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: 8d16980052d06739dc662fed100a80edec647240
4
- data.tar.gz: 21dbc29d2e39ebedeb215d981afd3b05adffcb66
3
+ metadata.gz: 8b56ec6bfc9b513e4e50ffd669412d52c617e310
4
+ data.tar.gz: e51669f40a922c9c9792572423f4062a0aa61c17
5
5
  SHA512:
6
- metadata.gz: cceaa2e604de1d9d11b77eb55b60d32ee61c95754cbd774367a717212b7a8fde31c176b099355d0c38716923f27acd9137b0a2229ddef0fd8e6cf57c534f58bc
7
- data.tar.gz: 8163fde9ea70d8e944fb5a11ce6eebe1b30121bcf22e8d312fa9e8553c156c003d4e4a6568793bd005843f89f042829ff14c9fe918175efe30656fd3a722a590
6
+ metadata.gz: 9972e55cc9b39f26813e87629ef5dd3e792bd6648fe3ac35816a5a54d4812c905dac4d81fb7f59586f9e9395c0d9022eaa1a61e9989c5bb9887cabc996e381fb
7
+ data.tar.gz: 306c8a7be338bfe0d5250b23bd8db28d9c93d70d73f0e87ce14de482e0eee6481d61261ad844b6efc93aaf83b3d53b5262d71d88436156185d7709d8735d01e8
data/lib/cantook/base.rb CHANGED
@@ -12,8 +12,6 @@ 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
17
15
 
18
16
  attr_accessor :base_url,
19
17
  :auth,
@@ -26,8 +24,7 @@ module Cantook
26
24
  :response,
27
25
  :query,
28
26
  :sale_state,
29
- :currency,
30
- :country
27
+ :currency
31
28
 
32
29
  # @param [Hash] params
33
30
  # @option params [String] :username - your Cantook API username
@@ -38,7 +35,6 @@ module Cantook
38
35
  # @option params [String] :format - format of the publication being sold, eg 'epub' or 'mobi'
39
36
  # @option params [String] :sale_state - use 'test' for test/development, nil for production (real sales)
40
37
  # @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.
42
38
  def initialize(params = {})
43
39
  @username = params[:username]
44
40
  @password = params[:password]
@@ -48,23 +44,19 @@ module Cantook
48
44
  @format = params[:format]
49
45
  @sale_state = params[:sale_state]
50
46
  @currency = params[:currency]
51
- @country = params[:country]
52
47
  @base_url = "https://#{platform}/api/organisations/#{organisation_id}"
53
48
  @auth = { username: username, password: password }
54
49
  end
55
50
 
56
51
  # @return [Hash] A basic hash of options common to all Cantook requests
57
52
  def base_options
58
- Rails.logger.info "COUNTRY: #{country}, SELF COUNTRY #{self.country}"
59
- { format: format, isbn: isbn, sale_state: sale_state, currency: currency, country: country }
53
+ { format: format, isbn: isbn, sale_state: sale_state, currency: currency}
60
54
  end
61
55
  private :base_options
62
56
 
63
57
  # @param [Hash] options
64
58
  def get_request options
65
- Rails.logger.info "BASE OPTIONS: #{base_options.inspect}"
66
59
  self.query = options.merge(base_options)
67
- Rails.logger.info "self query: #{self.query.inspect}"
68
60
  HTTParty.get(request_url, query: query, basic_auth: auth)
69
61
  end
70
62
  private :get_request
@@ -1,3 +1,3 @@
1
1
  module Cantook
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
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.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gordon B. Isnor