Class: Quby::Compiler::Entities::ScoreSchema
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Quby::Compiler::Entities::ScoreSchema
- Defined in:
- lib/quby/compiler/entities/score_schema.rb
Overview
ScoreSchema instances describe score definitions.
Score definitions are blocks of ruby code that return a hash of score results based on a questionnaire response (answer). These schemas describe the purpose and form of the scores. Each key-value pair of the result hash is called a subscore. The :value subscore is treated as the main score result. Subscores are usually identified by their ‘export_key’. The score value’s export_key is usually set to a shortened version of the main score key.
Instance Method Summary collapse
Instance Method Details
#export_key_labels ⇒ Object
21 22 23 |
# File 'lib/quby/compiler/entities/score_schema.rb', line 21 def export_key_labels subscore_schemas.map { |schema| [schema.export_key, schema.label] }.to_h.with_indifferent_access end |