phlexi-field 0.0.8 → 0.0.9
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 -4
- 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: 250be1049bb60d0ec4f8a97ed44aa2bac660f68f1c2761b2122bed9fa3942046
|
4
|
+
data.tar.gz: a630eb20c75e78690931486ad0ca2fcf246d3855ebe0acc82990cb59d02be193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b15190bcab618d0c1389f421a29e552e2196b8fa8fb85bd7a86489e0a5a6866fb0df78d8b1bef381d418525d26a24eeebdece30ab46c11f85de8c18d42bd67
|
7
|
+
data.tar.gz: c80e965b3e329bae6a0b63bc0ffbbbd530bd017f73d5b7152672b301c6f2e33de0cab5dc5affa7ed52b04daaf136dccea9ea4bb0689ee7bc2edee7f1728d9e95
|
@@ -51,8 +51,8 @@ module Phlexi
|
|
51
51
|
# end
|
52
52
|
# end
|
53
53
|
# ```
|
54
|
-
def nest_one(key, object: nil,
|
55
|
-
object ||= object_value_for(key: key)
|
54
|
+
def nest_one(key, as: nil, object: nil, default: nil, template: false, &)
|
55
|
+
object ||= object_value_for(key: key) || default
|
56
56
|
key = as || key
|
57
57
|
create_child(key, self.class, object:, template:, builder_klass:, &)
|
58
58
|
end
|
@@ -73,8 +73,8 @@ module Phlexi
|
|
73
73
|
# ```
|
74
74
|
# The object within the block is a `Namespace` object that maps each object within the enumerable
|
75
75
|
# to another `Namespace` or `Field`.
|
76
|
-
def nest_many(key, collection: nil,
|
77
|
-
collection ||= Array(object_value_for(key: key))
|
76
|
+
def nest_many(key, as: nil, collection: nil, default: nil, template: false, &)
|
77
|
+
collection ||= Array(object_value_for(key: key)).presence || default
|
78
78
|
key = as || key
|
79
79
|
create_child(key, self.class::NamespaceCollection, collection:, template:, &)
|
80
80
|
end
|
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.9
|
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-
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|