camille 0.5.12 → 0.5.13

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
  SHA256:
3
- metadata.gz: 321511ba40eb05246be9d567a74ac7c753287088b22e282207d6affe5cd2c7b6
4
- data.tar.gz: 4f7bec2b9a36f8dec419131cbbd1a98e3d4735f20155320b2419e6e2fe6600e4
3
+ metadata.gz: d72196c6854c4c1354a55e5560b649753e49e23875a96d903b2d197dbae72581
4
+ data.tar.gz: 43b711376dfa6e9311245463738d999ffe73abc8fa9c7eb9516100f0f778c018
5
5
  SHA512:
6
- metadata.gz: 676055618b2b681f821b3a2d0fa87bf0f60f52e0416aad2dbdbc51eb4186bd19c699f4a121265cba56d5a1128f241f1e9f3bd32a9d1779dca58cc902b888fd71
7
- data.tar.gz: e6545da7d1c98881b0fac58802b16c2a50ad2447039b9802d3617caf5f89d3ce68e67aaa2871f338b636fc463fb813f21ef1a040d13f5f43e70bf9ee890e2b29
6
+ metadata.gz: 513b2edc45cf95615c6a0d6768a09b7a9ec40fdafb79756694db91b72ab7c614b49140ed6cd7e4cba1a0e8a033e39c5b50aec3ac20d8e5fac25f9ba169f958af
7
+ data.tar.gz: '077171197c9aaea4b898ebe5157333d72b2f78297ec08b84605cf9da3615543e24af37f21d06d0a501bb1aa077aa21972e77c1f7c28967fff9274702578a22e1'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.13
4
+
5
+ ### Fixed
6
+
7
+ * Fixed that `Omit` and `Pick` did not preserve optional fields
8
+
3
9
  ## 0.5.12
4
10
 
5
11
  ### Added
@@ -2,7 +2,7 @@ module Camille
2
2
  module Types
3
3
  class Object < Camille::BasicType
4
4
  class ArgumentError < ::ArgumentError; end
5
- attr_reader :fields
5
+ attr_reader :fields, :optional_keys
6
6
 
7
7
  def initialize fields
8
8
  @optional_keys = []
@@ -12,6 +12,13 @@ module Camille
12
12
 
13
13
  def processed_object
14
14
  fields = @target_object.fields.reject{|k, _| @keys.include?(k)}
15
+ fields.transform_keys! do |k,_|
16
+ if @target_object.optional_keys.include?(k)
17
+ "#{k}?".to_sym
18
+ else
19
+ k
20
+ end
21
+ end
15
22
  Camille::Types::Object.new(fields)
16
23
  end
17
24
 
@@ -12,6 +12,13 @@ module Camille
12
12
 
13
13
  def processed_object
14
14
  fields = @target_object.fields.select{|k, _| @keys.include?(k)}
15
+ fields.transform_keys! do |k,_|
16
+ if @target_object.optional_keys.include?(k)
17
+ "#{k}?".to_sym
18
+ else
19
+ k
20
+ end
21
+ end
15
22
  Camille::Types::Object.new(fields)
16
23
  end
17
24
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Camille
4
- VERSION = "0.5.12"
4
+ VERSION = "0.5.13"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camille
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.12
4
+ version: 0.5.13
5
5
  platform: ruby
6
6
  authors:
7
- - 辻彩
7
+ - Alyssa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '8'
33
33
  description: ''
34
34
  email:
35
- - cichol@live.cn
35
+ - git@alyssa.fm
36
36
  executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []