phlexi-field 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phlexi/field/structure/namespace.rb +4 -2
- data/lib/phlexi/field/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: b81988b45868d71c491619e29435eeae401a9ce46d7e1f2e646d5fd2a0adc8af
|
4
|
+
data.tar.gz: 63c2472d49cb30609fabf6190c26e25801de083b9fece0918aac83bf761cb840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43654f76cfb84a8625b19a6147aa2bbb9bec4e01431be33f7ac6a27c9d288622d92a529214500ff412e08cb692e060d46443447d3066a7238a1a26a03a662052
|
7
|
+
data.tar.gz: 9ace64b95a34ebb011ed0bb2b273238f1e33f58373a90bf0bd5bfbc62068fcc86c6fba722bebe2323be25b2bc8a73915ad1153da772f7c9ebf7bb73cc5d4f75b
|
@@ -51,8 +51,9 @@ module Phlexi
|
|
51
51
|
# end
|
52
52
|
# end
|
53
53
|
# ```
|
54
|
-
def nest_one(key, object: nil, &)
|
54
|
+
def nest_one(key, object: nil, as: nil, &)
|
55
55
|
object ||= object_value_for(key: key)
|
56
|
+
key = as || key
|
56
57
|
create_child(key, self.class, object:, builder_klass:, &)
|
57
58
|
end
|
58
59
|
|
@@ -72,8 +73,9 @@ module Phlexi
|
|
72
73
|
# ```
|
73
74
|
# The object within the block is a `Namespace` object that maps each object within the enumerable
|
74
75
|
# to another `Namespace` or `Field`.
|
75
|
-
def nest_many(key, collection: nil, &)
|
76
|
+
def nest_many(key, collection: nil, as: nil, &)
|
76
77
|
collection ||= Array(object_value_for(key: key))
|
78
|
+
key = as || key
|
77
79
|
create_child(key, self.class::NamespaceCollection, collection:, &)
|
78
80
|
end
|
79
81
|
|
data/lib/phlexi/field/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlexi-field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Froelich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|