Class: REDCap::Form::CheckboxesWithOther

Inherits:
Checkboxes show all
Defined in:
lib/red_cap/form/fields.rb

Constant Summary

Constants inherited from Field

Field::KEYS

Instance Attribute Summary

Attributes inherited from Field

#attributes, #form, #responses

Instance Method Summary collapse

Methods inherited from RadioButtons

#options

Methods inherited from Field

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class REDCap::Form::Field

Instance Method Details

#other_text_fieldObject



116
117
118
# File 'lib/red_cap/form/fields.rb', line 116

def other_text_field
  associated_fields_for_key("501").find(&:text?)
end

#valueObject



106
107
108
109
110
111
112
113
114
# File 'lib/red_cap/form/fields.rb', line 106

def value
  selected_options.map do |key, value|
    if key == "501" # Other
      "#{value}: #{other_text_field&.value}"
    else
      value
    end
  end
end