Class: Quby::Questionnaires::Entities::OutcomeTable
- Inherits:
-
Object
- Object
- Quby::Questionnaires::Entities::OutcomeTable
- Includes:
- ActiveModel::Model
- Defined in:
- lib/quby/questionnaires/entities/outcome_table.rb
Overview
OutcomeTable describes how scores are formatted in a table in outcome views
Instance Attribute Summary collapse
-
#default_collapsed ⇒ Object
Returns the value of attribute default_collapsed.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#questionnaire ⇒ Object
Returns the value of attribute questionnaire.
-
#score_keys ⇒ Object
Returns the value of attribute score_keys.
-
#subscore_keys ⇒ Object
Returns the value of attribute subscore_keys.
Instance Method Summary collapse
Instance Attribute Details
#default_collapsed ⇒ Object
Returns the value of attribute default_collapsed.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def default_collapsed @default_collapsed end |
#key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def name @name end |
#questionnaire ⇒ Object
Returns the value of attribute questionnaire.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def questionnaire @questionnaire end |
#score_keys ⇒ Object
Returns the value of attribute score_keys.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def score_keys @score_keys end |
#subscore_keys ⇒ Object
Returns the value of attribute subscore_keys.
13 14 15 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 13 def subscore_keys @subscore_keys end |
Instance Method Details
#references_existing_score_keys ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/quby/questionnaires/entities/outcome_table.rb', line 19 def references_existing_score_keys (score_keys - questionnaire.score_schemas.values.map(&:key)).each do |missing_key| errors.add :score_keys, "#{missing_key.inspect} not found in score schemas" end existing_subscore_keys = questionnaire.score_schemas.values.flat_map(&:sub_score_schemas).map(&:key) (subscore_keys - existing_subscore_keys).each do |missing_key| errors.add :subscore_keys, "#{missing_key.inspect} not found in subscore schemas" end end |