Class: Quby::Compiler::Outputs::SeedSerializer
- Inherits:
-
Object
- Object
- Quby::Compiler::Outputs::SeedSerializer
- Defined in:
- lib/quby/compiler/outputs/seed_serializer.rb
Instance Attribute Summary collapse
-
#questionnaire ⇒ Object
readonly
Returns the value of attribute questionnaire.
-
#seeds ⇒ Object
readonly
Returns the value of attribute seeds.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(questionnaire) ⇒ SeedSerializer
constructor
A new instance of SeedSerializer.
Constructor Details
#initialize(questionnaire) ⇒ SeedSerializer
Returns a new instance of SeedSerializer.
10 11 12 13 |
# File 'lib/quby/compiler/outputs/seed_serializer.rb', line 10 def initialize(questionnaire) @questionnaire = questionnaire @seeds = seeds || [] end |
Instance Attribute Details
#questionnaire ⇒ Object (readonly)
Returns the value of attribute questionnaire.
7 8 9 |
# File 'lib/quby/compiler/outputs/seed_serializer.rb', line 7 def questionnaire @questionnaire end |
#seeds ⇒ Object (readonly)
Returns the value of attribute seeds.
8 9 10 |
# File 'lib/quby/compiler/outputs/seed_serializer.rb', line 8 def seeds @seeds end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/quby/compiler/outputs/seed_serializer.rb', line 15 def generate questionnaire.roqua_keys.map do |roqua_key| new_seed = Services::QubyProxy.new( questionnaire, quby_key: questionnaire.key, roqua_key: roqua_key, skip_score_keys_consistency_check: true ).generate Services::SeedDiff.new.apply_patch(new_seed, questionnaire.seeds_patch[roqua_key]) end end |