Class: Formalist::Elements::CheckBox

Inherits:
Field show all
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

Methods inherited from Field

#fill, #to_ast

Methods inherited from Formalist::Element

#==, build, fill, #fill, #to_ast, #type

Methods included from Formalist::Element::ClassInterface

#attribute, #attributes_schema, #type

Constructor Details

#initializeCheckBox

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