Sha256: 9b54a8fc481904802eea39be5fb0bb63cb86de939c823980db42e6686cbdd0b7
Contents?: true
Size: 1.03 KB
Versions: 42
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true module Ariadne module Forms module Dsl # :nodoc: class RadioButtonInput < Input attr_reader :name, :value, :label, :nested_form_block, :nested_form_arguments def initialize(name:, value:, label:, **options) @name = name @value = value @label = label super(**options) yield(self) if block_given? end # radio buttons cannot be invalid, as both selected and unselected are valid states # :nocov: def valid? true end # :nocov: def to_component Ariadne::Form::RadioButton::Component.new(name:, value:, label:, **@options) end def nested_form(**system_arguments, &block) @nested_form_arguments = system_arguments @nested_form_block = block end # :nocov: def type :radio_button end # :nocov: def supports_validation? false end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems