Class: GOVUKDesignSystemFormBuilder::Elements::File
- Includes:
- Traits::ContentBeforeAndAfter, Traits::Error, Traits::HTMLAttributes, Traits::HTMLClasses, Traits::Hint, Traits::Label, Traits::Supplemental
- Defined in:
- lib/govuk_design_system_formbuilder/elements/file.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name, attribute_name, hint:, label:, caption:, form_group:, javascript:, before_input:, after_input:, **kwargs, &block) ⇒ File
constructor
A new instance of File.
Methods included from Traits::ContentBeforeAndAfter
#after_input_content, #before_input_content
Methods included from Traits::HTMLClasses
Methods included from Traits::HTMLAttributes
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, hint:, label:, caption:, form_group:, javascript:, before_input:, after_input:, **kwargs, &block) ⇒ File
Returns a new instance of File.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/govuk_design_system_formbuilder/elements/file.rb', line 14 def initialize(builder, object_name, attribute_name, hint:, label:, caption:, form_group:, javascript:, before_input:, after_input:, **kwargs, &block) super(builder, object_name, attribute_name, &block) @label = label @caption = caption @hint = hint @html_attributes = kwargs @form_group = form_group @javascript = javascript @before_input = before_input @after_input = after_input end |
Instance Method Details
#html ⇒ Object
27 28 29 30 31 |
# File 'lib/govuk_design_system_formbuilder/elements/file.rb', line 27 def html Containers::FormGroup.new(*bound, **@form_group).html do safe_join([label_element, supplemental_content, hint_element, error_element, before_input_content, file_html, after_input_content]) end end |