Sha256: 2f2b0b4664d0c72d0fc6aca17cc8ce231c3fa2da748c72f9b4454df544f7659b
Contents?: true
Size: 930 Bytes
Versions: 22
Compression:
Stored size: 930 Bytes
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 def valid? true end 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: end end end end
Version data entries
22 entries across 22 versions & 2 rubygems