Class: Formalist::Elements::CheckBox
- Inherits:
-
Field
- Object
- Formalist::Element
- Field
- Formalist::Elements::CheckBox
- Defined in:
- lib/formalist/elements/standard/check_box.rb
Instance Attribute Summary
Attributes inherited from Formalist::Element
#attributes, #children, #errors, #input, #name
Instance Method Summary collapse
-
#initialize ⇒ CheckBox
constructor
A new instance of CheckBox.
Methods inherited from Field
Methods inherited from Formalist::Element
#==, build, fill, #fill, #to_ast, #type
Methods included from Formalist::Element::ClassInterface
#attribute, #attributes_schema, #type
Constructor Details
#initialize ⇒ CheckBox
Returns a new instance of CheckBox.
9 10 11 12 13 14 |
# File 'lib/formalist/elements/standard/check_box.rb', line 9 def initialize(**) super # Ensure value is a boolean (also: default to false for nil values) @input = !!@input end |