Class: Type::ArrayOfSymptomsType
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Type::ArrayOfSymptomsType
- Defined in:
- lib/kb/type/array_of_symptoms_type.rb
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#cast(value) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/kb/type/array_of_symptoms_type.rb', line 5 def cast(value) (value || []).map do |v| next v if v.is_a? KB::Symptom KB::Symptom.new v.symbolize_keys.slice(*SYMPTOM_KEYS) end end |