Class: REDCap::Form::CheckboxesWithRadioButtonsOrOther
- Inherits:
-
CheckboxesWithOther
- Object
- Struct
- Field
- RadioButtons
- Checkboxes
- CheckboxesWithOther
- REDCap::Form::CheckboxesWithRadioButtonsOrOther
- Defined in:
- lib/red_cap/form/fields.rb
Constant Summary
Constants inherited from Field
Instance Attribute Summary
Attributes inherited from Field
#associated_fields, #attributes, #options
Instance Method Summary collapse
Methods inherited from CheckboxesWithOther
Methods inherited from RadioButtons
Methods inherited from Field
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class REDCap::Form::Field
Instance Method Details
#value(responses) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/red_cap/form/fields.rb', line 138 def value responses radio_or_other_values = (responses).keys.map do |key| if other?(key) other_text_field(key)&.value(responses) else radio_field_for(key)&.value(responses) end end Hash[(responses).values.zip(radio_or_other_values)] end |