Sha256: 189a953c40797938fe503dd0491fe2ea68c7028c846e8249f42b950e16d5d238
Contents?: true
Size: 1 KB
Versions: 71
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module Primer module Forms module Dsl # :nodoc: class RadioButtonInput < Input attr_reader :name, :value, :label, :nested_form_block, :nested_form_arguments def initialize(name:, value:, label:, **system_arguments) @name = name @value = value @label = label super(**system_arguments) 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 RadioButton.new(input: self) 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
71 entries across 71 versions & 2 rubygems