lazy_lazer 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lazy_lazer/key_metadata_store.rb +12 -1
- data/lib/lazy_lazer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22872353f1cee531497c41b3d54db9f03b9ab9ee
|
4
|
+
data.tar.gz: 4fc8d26919472b31c3257798af077d5d2b5fc02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30fc0cb9bb106a2c6cc6f5dc959d920584bfbbf2dff95e5f5a5358fbe4542b91a5e4012b2b3446531f5662e2aa180b5722971e15030ff3e756d50914df2403f1
|
7
|
+
data.tar.gz: f39411ddcc2fb04c16149607586736b236f135e78521e8077f9b544d1b9a049fcc4c61cf1a69031e0431db4c9d3f69176e4ac2ed34d7adaf0953f7a8e4063fbd
|
@@ -11,13 +11,24 @@ module LazyLazer
|
|
11
11
|
@required_properties = []
|
12
12
|
end
|
13
13
|
|
14
|
+
# Used for {Object#dup}.
|
15
|
+
def initialize_copy(original)
|
16
|
+
super
|
17
|
+
@collection = original.instance_variable_get(:@collection).dup
|
18
|
+
@required_properties = original.instance_variable_get(:@required_properties).dup
|
19
|
+
end
|
20
|
+
|
14
21
|
# Add a KeyMetadata to the store.
|
15
22
|
# @param key [Symbol] the key
|
16
23
|
# @param meta [KeyMetadata] the key metadata
|
17
24
|
# @return [KeyMetadata] the provided meta
|
18
25
|
def add(key, meta)
|
19
26
|
@collection[key] = meta
|
20
|
-
|
27
|
+
if meta.required?
|
28
|
+
@required_properties << key
|
29
|
+
else
|
30
|
+
@required_properties.delete(key)
|
31
|
+
end
|
21
32
|
meta
|
22
33
|
end
|
23
34
|
|
data/lib/lazy_lazer/version.rb
CHANGED