Class: Formalist::Elements::CheckBox

Inherits:
Field show all
Defined in:
lib/formalist/elements/standard/check_box.rb

Instance Attribute Summary

Attributes inherited from Field

#name, #predicates

Attributes inherited from Formalist::Element

#attributes, #children, #errors, #input

Instance Method Summary collapse

Methods inherited from Field

#to_ast

Methods inherited from Formalist::Element

#to_ast, #type

Methods included from Formalist::Element::ClassInterface

attribute, attributes_schema, permitted_children, type

Constructor Details

#initializeCheckBox

Returns a new instance of CheckBox.



10
11
12
13
14
15
# File 'lib/formalist/elements/standard/check_box.rb', line 10

def initialize(*)
  super

  # Ensure value is a boolean (also: default to false for nil values)
  @input = !!@input
end