Class: GOVUKDesignSystemFormBuilder::Elements::Date
- Includes:
- Traits::Error, Traits::HTMLClasses, Traits::Hint, Traits::Supplemental
- Defined in:
- lib/govuk_design_system_formbuilder/elements/date.rb
Constant Summary collapse
- MULTIPARAMETER_KEY =
{ day: 3, month: 2, year: 1 }.freeze
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, segments:, form_group:, date_of_birth: false, **kwargs, &block) ⇒ Date
constructor
A new instance of Date.
Methods included from Traits::HTMLClasses
Methods included from Traits::Supplemental
Methods included from Traits::Hint
Methods included from Traits::Error
Methods inherited from Base
Constructor Details
#initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, segments:, form_group:, date_of_birth: false, **kwargs, &block) ⇒ Date
Returns a new instance of Date.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/govuk_design_system_formbuilder/elements/date.rb', line 13 def initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, segments:, form_group:, date_of_birth: false, **kwargs, &block) super(builder, object_name, attribute_name, &block) @legend = legend @caption = @hint = hint @date_of_birth = date_of_birth @omit_day = omit_day @maxlength_enabled = maxlength_enabled @segments = segments @form_group = form_group @html_attributes = kwargs end |
Instance Method Details
#html ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/govuk_design_system_formbuilder/elements/date.rb', line 27 def html Containers::FormGroup.new(*bound, **@form_group, **@html_attributes).html do Containers::Fieldset.new(*bound, **).html do safe_join([supplemental_content, hint_element, error_element, date]) end end end |