foobara 0.0.88 → 0.0.89

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: 5abb6c21d367251512e93a28585ca52fbef92cbea5bd4b6f102f693ae7e42969
4
- data.tar.gz: 2219f04cbb8cd7fa1b4f296fe229416cb344fd30bdd4fe529cb619b820a45f03
3
+ metadata.gz: 424a065d4e4a0543f55ac9c3b7c0c87db4a5f334241c5b8e5a46b44a45907a55
4
+ data.tar.gz: ec082f769eaae6bc5f9b4dd079722b044e417243ad1cf0cabcf0c21b9648efa6
5
5
  SHA512:
6
- metadata.gz: df26075b6ad2825133cd77b08e6c5813756fe130244b4d21ca0c312a734380c40668ce5a066e102a2b321a66f08ddf51a9a2499af1c243a603db40c3057aa60a
7
- data.tar.gz: 8c4ef51ae4cb5fc93c31e3b739f0b919c91cad78944cbeeea25d324f607020aff47ff7ae8166e24fd17dc9aff61dab9962b29833d505e77f1833a8af40a56c1e
6
+ metadata.gz: 5b6b51362c480c26f1690c17874607a2bcf34d14b6d3882665798efe6511e3fc2f602214cae1b005dd788cf23f33a68a4c1781b631108248e2bb1baca0ed0204
7
+ data.tar.gz: 2e910c95484b092eb2bfdef1eeed079f99794801a3bb345efc0291f51ca1b832301f3540e454b0bd749d9028b591bbc3b919a0301d03db965e576644c9c72284
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.0.89] - 2025-03-29
2
+
3
+ - Make attributes transformers work with either a from type or a to type
4
+
1
5
  # [0.0.88] - 2025-03-28
2
6
 
3
7
  - Implement response mutator concept
@@ -15,8 +15,17 @@ module Foobara
15
15
  end
16
16
 
17
17
  def to_type_declaration
18
- from_declaration = from_type.declaration_data
19
- TypeDeclarations::Attributes.only(from_declaration, *self.class.only_attributes)
18
+ if from_type
19
+ from_declaration = from_type.declaration_data
20
+ TypeDeclarations::Attributes.only(from_declaration, *self.class.only_attributes)
21
+ end
22
+ end
23
+
24
+ def from_type_declaration
25
+ if to_type
26
+ to_declaration = to_type.declaration_data
27
+ TypeDeclarations::Attributes.only(to_declaration, *self.class.only_attributes)
28
+ end
20
29
  end
21
30
 
22
31
  def transform(inputs)
@@ -15,8 +15,17 @@ module Foobara
15
15
  end
16
16
 
17
17
  def to_type_declaration
18
- from_declaration = from_type.declaration_data
19
- TypeDeclarations::Attributes.reject(from_declaration, *self.class.reject_attributes)
18
+ if from_type
19
+ from_declaration = from_type.declaration_data
20
+ TypeDeclarations::Attributes.reject(from_declaration, *self.class.reject_attributes)
21
+ end
22
+ end
23
+
24
+ def from_type_declaration
25
+ if to_type
26
+ to_declaration = to_type.declaration_data
27
+ TypeDeclarations::Attributes.reject(to_declaration, *self.class.reject_attributes)
28
+ end
20
29
  end
21
30
 
22
31
  def transform(inputs)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.88
4
+ version: 0.0.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-28 00:00:00.000000000 Z
10
+ date: 2025-03-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal