ravioli 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravioli/configuration.rb +9 -1
- data/lib/ravioli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aefb9753a481282a8f9f715721f642db0767ce193356b4447088eccc15a4a6d
|
4
|
+
data.tar.gz: 46985d21d775497fff718b5f9c15f15529f89127a950e2ad772f605c284b2cc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9f300878dd25c69cc41612c0aa34e144533e98aae70ee800e17f42b49b06d4d5a581f0a76ac30659dec81e4a00bbdeb7f3b98358d818a597576b93c2926c6ef
|
7
|
+
data.tar.gz: f5be20c80174caa8606a2470ded64ce82de3dc71122a07cf58166edaaa4c77207eb26d13dc33de8aa211b79d4b935fff5057ccf24dfb84f0ae9df83d7a2e718d
|
@@ -68,7 +68,7 @@ module Ravioli
|
|
68
68
|
if value.is_a?(Hash)
|
69
69
|
original_value = dig(*Array(key))
|
70
70
|
transform = ->(value) { value.is_a?(self.class) ? value.table.deep_transform_values(&transform) : value }
|
71
|
-
original_value = original_value.table.deep_transform_values(&transform) if original_value.is_a?(
|
71
|
+
original_value = original_value.table.deep_transform_values(&transform) if original_value.is_a?(self.class)
|
72
72
|
value = original_value.deep_merge(value.deep_symbolize_keys) if original_value.is_a?(Hash)
|
73
73
|
build(key, value)
|
74
74
|
else
|
@@ -91,6 +91,14 @@ module Ravioli
|
|
91
91
|
Array(key_path) + Array(keys)
|
92
92
|
end
|
93
93
|
|
94
|
+
# Ruby 3's OStruct doesn't protect the `class` method ... which is dumb. Let's protect all
|
95
|
+
# public instance methods; this will just prevent reader attrs from being written. Things are
|
96
|
+
# still accessible via hash notation, e.g. `Rails.config[:class]`
|
97
|
+
def is_method_protected!(name)
|
98
|
+
return true if singleton_class.method_defined?(name)
|
99
|
+
super
|
100
|
+
end
|
101
|
+
|
94
102
|
# rubocop:disable Style/MissingRespondToMissing
|
95
103
|
def method_missing(method, *args, &block)
|
96
104
|
return super unless args.empty?
|
data/lib/ravioli/version.rb
CHANGED