Class: REDCap::Form::CheckboxesWithCheckboxesOrOther
- Inherits:
-
CheckboxesWithOther
- Object
- Struct
- Field
- RadioButtons
- Checkboxes
- CheckboxesWithOther
- REDCap::Form::CheckboxesWithCheckboxesOrOther
- 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
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/red_cap/form/fields.rb', line 158 def value responses left = (responses).values right = (responses).keys.map do |key| checkbox_fields_for(key).map do |field| field.value(responses) end end if .keys.include?("501") right[-1] = [other_text_field("501")&.value(responses)] end Hash[left.zip(right)] end |