Sha256: 984a89dcfbd846b62a13d3eb468c80586367eb47c829328f2182b2cc375dbe05

Contents?: true

Size: 396 Bytes

Versions: 10

Compression:

Stored size: 396 Bytes

Contents

require "formalist/element"
require "formalist/elements"
require "formalist/types"

module Formalist
  class Elements
    class CheckBox < Field
      attribute :question_text, Types::String

      def initialize(*)
        super

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

    register :check_box, CheckBox
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
formalist-0.5.4 lib/formalist/elements/standard/check_box.rb
formalist-0.5.3 lib/formalist/elements/standard/check_box.rb
formalist-0.5.2 lib/formalist/elements/standard/check_box.rb
formalist-0.5.1 lib/formalist/elements/standard/check_box.rb
formalist-0.5.0 lib/formalist/elements/standard/check_box.rb
formalist-0.4.2 lib/formalist/elements/standard/check_box.rb
formalist-0.4.1 lib/formalist/elements/standard/check_box.rb
formalist-0.4.0 lib/formalist/elements/standard/check_box.rb
formalist-0.3.0 lib/formalist/elements/standard/check_box.rb
formalist-0.2.3 lib/formalist/elements/standard/check_box.rb