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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a93196112cf2988e3893ae65133271d65cfe8a3c118c274dd7170bd30735a67
4
- data.tar.gz: 9f8c007cbbe91c52d856485a30ad0db0f72a5d687e62c2202a4c1e6703a5bfd9
3
+ metadata.gz: b81988b45868d71c491619e29435eeae401a9ce46d7e1f2e646d5fd2a0adc8af
4
+ data.tar.gz: 63c2472d49cb30609fabf6190c26e25801de083b9fece0918aac83bf761cb840
5
5
  SHA512:
6
- metadata.gz: 1937ee5a4b0d478a67a38b0d098e305ffcafb27556957dfca8bcc1b827688feabfc29fffd0bb7f91159b0519b017cb4da8fa2bb3e62c3651f53d5cf58ef6ca76
7
- data.tar.gz: 1b43ffa71ec09cf7a8c959b564485ed9d0486e031a4627c7c12f4b611d063ec19115128e9210e3e43981a887e71d11544169cd24395b793d990c13b0856329a2
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Field
5
- VERSION = "0.0.6"
5
+ VERSION = "0.0.7"
6
6
  end
7
7
  end
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.6
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-10-25 00:00:00.000000000 Z
11
+ date: 2024-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex