Class: GOVUKDesignSystemFormBuilder::Elements::Password
- Defined in:
- lib/govuk_design_system_formbuilder/elements/password.rb
Defined Under Namespace
Classes: I18nAttr
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name, attribute_name, label:, caption:, hint:, form_group:, show_password_text:, hide_password_text:, show_password_aria_label_text:, hide_password_aria_label_text:, password_hidden_announcement_text:, password_shown_announcement_text:, **kwargs, &block) ⇒ Password
constructor
A new instance of Password.
Methods included from Traits::HTMLClasses
Methods included from Traits::HTMLAttributes
Methods included from Traits::Hint
Methods included from Traits::Error
Methods inherited from Base
Constructor Details
#initialize(builder, object_name, attribute_name, label:, caption:, hint:, form_group:, show_password_text:, hide_password_text:, show_password_aria_label_text:, hide_password_aria_label_text:, password_hidden_announcement_text:, password_shown_announcement_text:, **kwargs, &block) ⇒ Password
Returns a new instance of Password.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/govuk_design_system_formbuilder/elements/password.rb', line 14 def initialize(builder, object_name, attribute_name, label:, caption:, hint:, form_group:, show_password_text:, hide_password_text:, show_password_aria_label_text:, hide_password_aria_label_text:, password_hidden_announcement_text:, password_shown_announcement_text:, **kwargs, &block) super(builder, object_name, attribute_name, &block) @label = label @caption = @hint = hint @form_group = form_group @html_attributes = kwargs @show_password_text = show_password_text @hide_password_text = hide_password_text @show_password_aria_label_text = show_password_aria_label_text @hide_password_aria_label_text = hide_password_aria_label_text @password_shown_announcement_text = password_shown_announcement_text @password_hidden_announcement_text = password_hidden_announcement_text end |
Instance Method Details
#html ⇒ Object
33 34 35 36 37 |
# File 'lib/govuk_design_system_formbuilder/elements/password.rb', line 33 def html Containers::FormGroup.new(*bound, **).html do safe_join([label_element, hint_element, error_element, ]) end end |