class REDCap::Form::CheckboxesWithRadioButtonsOrOther

Public Instance Methods

value(responses) click to toggle source
# File lib/red_cap/form/fields.rb, line 137
def value responses
  radio_or_other_values = selected_options(responses).keys.map do |key|
    if other?(key)
      other_text_field(key)&.value(responses)
    else
      radio_field_for(key)&.value(responses)
    end
  end

  Hash[selected_options(responses).values.zip(radio_or_other_values)]
end

Private Instance Methods

radio_field_for(key) click to toggle source
# File lib/red_cap/form/fields.rb, line 151
def radio_field_for key
  associated_fields_for_key(key).find(&:radio?)
end