tribune_recurly_api 1.0.4 → 1.0.5

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: 710191b3144933ba14175b9f79f8b913c1838daf314103e03b2ce3c2a01d6c7b
4
- data.tar.gz: 1c590a30db886709b49db2628a532de7da49f1bcc2774274e992a486095821e8
3
+ metadata.gz: 330e1d6e2d4a12cf9d767a5e3223e80bde8b4f7c31ddee9c6395eb062f36e7b4
4
+ data.tar.gz: 8e3c9f7293df1eb36de9dcf29f4a24f15c7d6833f5f24a74359f0f42d36c9375
5
5
  SHA512:
6
- metadata.gz: b5357d11ad9b95582f81582fb3aec20759c3bc4fc5072e8608908d10a7fcb07f01d96e837235300bbdf6df2de3cf58eb38a6634fc37e3334f59a9374061b8993
7
- data.tar.gz: cd48953eb36937260352b95ec6c58076204e261a604b33da7812eebc487de3fb9f2788012d6a33cf0690f47974100e2b16591a51a41e9a279d9142dbbb1c164a
6
+ metadata.gz: 2c082798d31feedaeb831c04f51f7c7dcec8035b5549cdee6d0de909ba1171516e65445a27c34ab89d9421f8642adc2669aea284e8adeddd0c08abdb4e3d1cb9
7
+ data.tar.gz: 032d4515cac6bb3b2c8e98573b9d4e4164472185f3691a67051fb2cc11e9a047a23eafb6a61c52aafeaef5f400ad40bd2dd7ac218e06843ee26446e98bf63e79
@@ -10,8 +10,9 @@ module RecurlyApi
10
10
  def account_info(ssor_id:, **optional_params)
11
11
  # cache_key should be uniq for each account(here ssor_id is uniq)
12
12
  # final cache key with prefix: tribune_recurly_api.account_info.<abcdef>
13
- self.cache_key_name = "account_info.#{ssor_id}" unless bypass_caching?
14
- request_api(path_name: "accounts/code-#{ssor_id}", **optional_params) # cache_key_name: cache_key_name
13
+ cache_key_name = "account_info.#{ssor_id}"
14
+ request_api(path_name: "accounts/code-#{ssor_id}",
15
+ cache_key_name: cache_key_name, **optional_params)
15
16
  end
16
17
 
17
18
  # Deactivate account ---
@@ -10,8 +10,9 @@ module RecurlyApi
10
10
  def coupon_redemptions(ssor_id:, **optional_params)
11
11
  # cache_key should be uniq for each account(here ssor_id is uniq)
12
12
  # final cache key with prefix: tribune_recurly_api.coupon_redemptions.<abcdef>
13
- self.cache_key_name = "coupon_redemptions.#{ssor_id}" unless bypass_caching?
14
- request_api(path_name: "accounts/code-#{ssor_id}/coupon_redemptions", **optional_params)
13
+ cache_key_name = "coupon_redemptions.#{ssor_id}"
14
+ request_api(path_name: "accounts/code-#{ssor_id}/coupon_redemptions",
15
+ cache_key_name: cache_key_name, **optional_params)
15
16
  end
16
17
 
17
18
  # Other request any.....
@@ -28,8 +28,8 @@ module RecurlyApi
28
28
  # payload_name = optional_params[:payload_name] # if not present default value is :payload
29
29
  # cache_key_name = 'list_all_plans' # optional by default cache_key is caller method_name in receiver i.e. list_plans here
30
30
  self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:plan_expiry] unless bypass_caching?
31
- request_api(path_name: 'plans', query_params: recurly_query_params,
32
- cache_key_name: cache_key_name, **optional_params)
31
+ # cache_key_name = 'all_plans' # for custom cache key pass as extra argument
32
+ request_api(path_name: 'plans', query_params: recurly_query_params, **optional_params)
33
33
  end
34
34
 
35
35
  # Fetch Plan Info--
@@ -41,8 +41,9 @@ module RecurlyApi
41
41
  self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:plan_expiry] unless bypass_caching?
42
42
  # cache_key should be uniq for each plan(here plan_id is uniq)
43
43
  # final cache key with prefix: tribune_recurly_api.plan_info.<abcdef>
44
- self.cache_key_name = "plan_info.#{plan_id}" unless bypass_caching?
45
- request_api(path_name: "plans/#{plan_id}", **optional_params)
44
+ cache_key_name = "plan_info.#{plan_id}"
45
+ request_api(path_name: "plans/#{plan_id}",
46
+ cache_key_name: cache_key_name, **optional_params)
46
47
  end
47
48
  end
48
49
  end
@@ -13,8 +13,9 @@ module RecurlyApi
13
13
  self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:subscription_expiry] unless bypass_caching?
14
14
  # cache_key should be uniq for each account(here ssor_id is uniq)
15
15
  # final cache key with prefix: tribune_recurly_api.account_subscriptions.<abcdef>
16
- self.cache_key_name = "account_subscriptions.#{ssor_id}" unless bypass_caching?
17
- request_api(path_name: path, query_params: recurly_query_params, **optional_params)
16
+ cache_key_name = "account_subscriptions.#{ssor_id}"
17
+ request_api(path_name: path, query_params: recurly_query_params,
18
+ cache_key_name: cache_key_name, **optional_params)
18
19
  end
19
20
 
20
21
  # Checking if user already has subscription OR
@@ -1,33 +1,33 @@
1
- # frozen_string_literal: true
2
-
3
- # Logger for Gem
4
- module RecurlyApi
5
- # fallback to STDOUT for non-rails project
6
- module Logging
7
- # accessor setter method
8
- attr_writer :logger
9
-
10
- # Fallback to STDOUT logger for non-rails applications
11
- # Usage examples to logging details in RecurlyApi:Client
12
- # a. logger.info("I'm an info log")
13
- # b. logger.warn("I'm a warn log")
14
- # c. logger.error("I'm an error log: error message")
15
- # d. logger.fatal("I'm a fatal log")
16
- def logger
17
- @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
18
- end
19
-
20
- # Classical set method(instead used attr_writer)
21
- # def logger=(logger)
22
- # @logger = logger
23
- # end
24
-
25
- def logger_heading
26
- 'tribune_recurly_api'
27
- end
28
-
29
- def logger_cache_heading
30
- "#{logger_heading} CACHING"
31
- end
32
- end
33
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Logger for Gem
4
+ module RecurlyApi
5
+ # fallback to STDOUT for non-rails project
6
+ module Logging
7
+ # accessor setter method
8
+ attr_writer :logger
9
+
10
+ # Fallback to STDOUT logger for non-rails applications
11
+ # Usage examples to logging details in RecurlyApi:Client
12
+ # a. logger.info("I'm an info log")
13
+ # b. logger.warn("I'm a warn log")
14
+ # c. logger.error("I'm an error log: error message")
15
+ # d. logger.fatal("I'm a fatal log")
16
+ def logger
17
+ @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
18
+ end
19
+
20
+ # Classical set method(instead used attr_writer)
21
+ # def logger=(logger)
22
+ # @logger = logger
23
+ # end
24
+
25
+ def logger_heading
26
+ 'tribune_recurly_api'
27
+ end
28
+
29
+ def logger_cache_heading
30
+ "#{logger_heading} CACHING"
31
+ end
32
+ end
33
+ end
@@ -17,5 +17,6 @@ module RecurlyApi
17
17
  # VERSION = '1.0.1' # cache settings from configuration file
18
18
  # VERSION = '1.0.2' # prefixing '<code->' to ssor_id is now part of GEM
19
19
  # VERSION = '1.0.3' # return recurly error response
20
- VERSION = '1.0.4' # cache key should be uniq
20
+ # VERSION = '1.0.4' # is yanked in rubygems.org
21
+ VERSION = '1.0.5' # cache key should be uniq
21
22
  end
@@ -1,3 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
- require 'recurly_api'
1
+ # frozen_string_literal: true
2
+
3
+ require 'recurly_api'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tribune_recurly_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - udevulapally