camille 0.5.10 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/camille/types/object.rb +8 -5
- data/lib/camille/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: 9d5030e35bf654863f03d80dbd09f8adb03b335f3f66d52c745404f6344e7efc
|
4
|
+
data.tar.gz: 7cc7a7000f5ce205f8edabfa31046933b7c7e04a71b18a270a8a080b37ed0c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746548d7942f95c217ad8763add318a2dab939dbe2fb1abbd26d88b3c7da76023f58946a5622b15d5e3107ea7a88bfb919c78526eac78dbd6f9520d4f6e11469
|
7
|
+
data.tar.gz: 5460ccaaa044c4a4a1255b68d3df78e1f251931a725b26ff36155dd29695c0422097287c07efb0f405d2928aa088022c03fd8bbf64ed652c64f450a688c9d1c1
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/camille/types/object.rb
CHANGED
@@ -14,11 +14,10 @@ module Camille
|
|
14
14
|
keys = (@fields.keys + value.keys).uniq
|
15
15
|
transform_and_check_results = keys.map do |key|
|
16
16
|
if type = @fields[key]
|
17
|
-
|
18
|
-
if @optional_keys.include?(key) && !error && transformed.nil?
|
17
|
+
if @optional_keys.include?(key) && value[key].nil?
|
19
18
|
nil
|
20
19
|
else
|
21
|
-
[key, [
|
20
|
+
[key, type.transform_and_check(value[key])]
|
22
21
|
end
|
23
22
|
else
|
24
23
|
[key, [nil, value[key]]]
|
@@ -43,7 +42,7 @@ module Camille
|
|
43
42
|
end
|
44
43
|
|
45
44
|
def literal
|
46
|
-
"{#{@fields.map{|k,v| "#{
|
45
|
+
"{#{@fields.map{|k,v| "#{literal_key k}: #{v.literal}"}.join(', ')}}"
|
47
46
|
end
|
48
47
|
|
49
48
|
private
|
@@ -54,7 +53,7 @@ module Camille
|
|
54
53
|
if key.end_with?('?')
|
55
54
|
new_key = remove_question_mark(key)
|
56
55
|
@optional_keys << new_key
|
57
|
-
[new_key, type
|
56
|
+
[new_key, type]
|
58
57
|
else
|
59
58
|
[key, type]
|
60
59
|
end
|
@@ -65,6 +64,10 @@ module Camille
|
|
65
64
|
sym.to_s.gsub(/\?$/, '').to_sym
|
66
65
|
end
|
67
66
|
|
67
|
+
def literal_key key
|
68
|
+
"#{ActiveSupport::Inflector.camelize key.to_s, false}#{@optional_keys.include?(key) ? '?' : ''}"
|
69
|
+
end
|
70
|
+
|
68
71
|
def check_case_conversion_safe sym
|
69
72
|
str = sym.to_s
|
70
73
|
if str != str.camelize.underscore
|
data/lib/camille/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 辻彩
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|