katalyst-govuk-formbuilder 1.7.0 → 1.7.1

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: da18c9d693b01288822028e2c8a5ba21100f572a6456e71139cb494bdf71055b
4
- data.tar.gz: 82a435c77c19acc42f02b130d3a01b6471829295d7ff3c3c99c2b005cf4e87f2
3
+ metadata.gz: d500045cb23ba6da9d6df55b1584249c2b95fadb8e44b0e8ea1fe63f58bbb5a1
4
+ data.tar.gz: 58dce6296ea70daee510c44a9c8bb403a3aed623cefff5496af5ff08cbe5b25c
5
5
  SHA512:
6
- metadata.gz: e6c9fa57613d0f2bec841a478cfcaa2a283b006f3d7f2d8fb2802859bc5eb9d0c409b598aa143fa15ec8147f417433a508ddc5ce4b42f8a4ff57028fa48a5d5a
7
- data.tar.gz: f4cd060ee723cc5f029ec7270969f262afd8a0dbf4a6a1d55f86b660d84a68d9b23d650e3722bbdc3ec1e23da7b1b37acf4d5a90e0916aef1a5c090073cf299b
6
+ metadata.gz: 37feec9e8a284f7ef6da32ea78543d6c525538485586a13cf7037f8ce8db0f7853111b1becbf8d26f9aeaacf7a164c243803d6adcbac9a4c6773eb5f717ee057
7
+ data.tar.gz: 956f29c704ddb6f99fe490142560945dc6f5738ec5af99601a7e83d1d1c963345c9720623007c0ca9c6c39215bb653af63e05b38f21d262b1535ddc2bfcf62de
@@ -152,6 +152,22 @@ module GOVUKDesignSystemFormBuilder
152
152
  @builder.object.class.human_attribute_name(@attribute_name)
153
153
  end
154
154
  end
155
+
156
+ class Legend
157
+ def retrieve_text(supplied_text)
158
+ supplied_text.presence ||
159
+ localised_text(:legend).presence ||
160
+ human_attribute_name.presence ||
161
+ @attribute_name.to_s.humanize.capitalize.presence
162
+ end
163
+
164
+ def human_attribute_name
165
+ return unless @object_name.present? && @attribute_name.present?
166
+ return unless @builder.object&.class.respond_to?(:human_attribute_name)
167
+
168
+ @builder.object.class.human_attribute_name(@attribute_name)
169
+ end
170
+ end
155
171
  end
156
172
 
157
173
  module Containers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-govuk-formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive