iron_bank 4.0.1 → 4.0.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/iron_bank/describe/excluded_fields.rb +8 -4
- data/lib/iron_bank/metadata.rb +7 -0
- data/lib/iron_bank/resources/invoice.rb +5 -1
- data/lib/iron_bank/resources/product_rate_plan.rb +5 -1
- data/lib/iron_bank/resources/rate_plan_charge.rb +5 -1
- data/lib/iron_bank/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eb89daa7f5b7a8a07c63cd2da6dbf61d815d43186068916a27bfba75b11454b
|
4
|
+
data.tar.gz: 794b52f7e1d01cd7096f89627fde936867ecc9d66df60f29985cbb0c1d722be1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528398a47469aeb59ce99ff48f24800855a9b8200277972bcd8ace8cc41b1608f3bbbe8d210209421ed1ee9c15209727fa75978e22f5abce4023aa40c42477d6
|
7
|
+
data.tar.gz: 84a42db908a7016dcfb53ad161f2a99552adba4639d7f17679785e964bf51e28322c6cb13cd87bb0e43205e19eb6011789544bb9e5218b3a5246d24f08aaa596
|
data/Gemfile.lock
CHANGED
@@ -41,18 +41,18 @@ module IronBank
|
|
41
41
|
def call
|
42
42
|
remove_last_failure_fields until valid_query?
|
43
43
|
|
44
|
-
excluded_fields
|
44
|
+
excluded_fields - single_resource_query_fields
|
45
45
|
end
|
46
46
|
|
47
47
|
private
|
48
48
|
|
49
|
-
attr_reader :object_name, :
|
49
|
+
attr_reader :object_name, :last_failed_fields
|
50
50
|
|
51
51
|
def_delegators "IronBank.logger", :info
|
52
|
+
def_delegators :object, :single_resource_query_fields
|
52
53
|
|
53
54
|
def initialize(object_name)
|
54
55
|
@object_name = object_name
|
55
|
-
@excluded_fields = []
|
56
56
|
@last_failed_fields = nil
|
57
57
|
end
|
58
58
|
|
@@ -60,6 +60,10 @@ module IronBank
|
|
60
60
|
IronBank::Resources.const_get(object_name)
|
61
61
|
end
|
62
62
|
|
63
|
+
def excluded_fields
|
64
|
+
@excluded_fields ||= object.excluded_fields.dup
|
65
|
+
end
|
66
|
+
|
63
67
|
def remove_last_failure_fields
|
64
68
|
query_fields = object.query_fields
|
65
69
|
|
@@ -67,7 +71,7 @@ module IronBank
|
|
67
71
|
last_failed_fields.any? { |failed| field.casecmp?(failed) }
|
68
72
|
end
|
69
73
|
|
70
|
-
|
74
|
+
excluded_fields.push(*failed_fields)
|
71
75
|
|
72
76
|
# Remove the field for the next query
|
73
77
|
query_fields.delete_if { |field| failed_fields.include?(field) }
|
data/lib/iron_bank/metadata.rb
CHANGED
@@ -12,6 +12,13 @@ module IronBank
|
|
12
12
|
fields.fetch(object_name, [])
|
13
13
|
end
|
14
14
|
|
15
|
+
# NOTE: For some resources, fields are queryable with some restrictions,
|
16
|
+
# e.g. the `Invoice#body` can only be added to the list of fields if
|
17
|
+
# there is only one invoice in the query response.
|
18
|
+
def single_resource_query_fields
|
19
|
+
[]
|
20
|
+
end
|
21
|
+
|
15
22
|
def fields
|
16
23
|
return [] unless schema
|
17
24
|
|
@@ -8,7 +8,11 @@ module IronBank
|
|
8
8
|
class Invoice < Resource
|
9
9
|
# See the comment for the instance method `#body`
|
10
10
|
def self.excluded_fields
|
11
|
-
super +
|
11
|
+
super + single_resource_query_fields
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.single_resource_query_fields
|
15
|
+
%w[Body]
|
12
16
|
end
|
13
17
|
|
14
18
|
with_schema
|
@@ -9,7 +9,11 @@ module IronBank
|
|
9
9
|
# NOTE: Zuora doesn't let us query for more than one product rate plan
|
10
10
|
# `ActiveCurrencies` at a time
|
11
11
|
def self.excluded_fields
|
12
|
-
super +
|
12
|
+
super + single_resource_query_fields
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.single_resource_query_fields
|
16
|
+
%w[ActiveCurrencies]
|
13
17
|
end
|
14
18
|
|
15
19
|
with_schema
|
data/lib/iron_bank/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickael Pham
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-09-
|
14
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bump
|