Class: REDCap::Form::CheckboxesWithOther
- Inherits:
-
Checkboxes
- Object
- Struct
- Field
- RadioButtons
- Checkboxes
- REDCap::Form::CheckboxesWithOther
- Defined in:
- lib/red_cap/form/fields.rb
Direct Known Subclasses
CheckboxesWithCheckboxesOrOther, CheckboxesWithRadioButtonsOrOther
Constant Summary
Constants inherited from Field
Instance Attribute Summary
Attributes inherited from Field
#associated_fields, #attributes, #options
Instance Method Summary collapse
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
#other?(key) ⇒ Boolean
129 130 131 |
# File 'lib/red_cap/form/fields.rb', line 129 def other? key other_text_field(key) end |
#other_text_field(key) ⇒ Object
125 126 127 |
# File 'lib/red_cap/form/fields.rb', line 125 def other_text_field key associated_fields_for_key(key).find(&:text?) end |
#value(responses) ⇒ Object
115 116 117 118 119 120 121 122 123 |
# File 'lib/red_cap/form/fields.rb', line 115 def value responses (responses).map do |key, value| if other?(key) "#{value}: #{other_text_field(key).value(responses)}" else value end end end |