Class: ScoreCollection
- Inherits:
-
Object
- Object
- ScoreCollection
- Includes:
- YAMLInteraction
- Defined in:
- lib/html_compilation/classes/struct_classes/score_collection.rb
Instance Attribute Summary collapse
-
#guidelines ⇒ Object
Returns the value of attribute guidelines.
Instance Method Summary collapse
- #get_guidelines(ddl) ⇒ Object
-
#initialize(ddl = "./data/scores.yaml") ⇒ ScoreCollection
constructor
A new instance of ScoreCollection.
Methods included from YAMLInteraction
Constructor Details
#initialize(ddl = "./data/scores.yaml") ⇒ ScoreCollection
Returns a new instance of ScoreCollection.
7 8 9 |
# File 'lib/html_compilation/classes/struct_classes/score_collection.rb', line 7 def initialize(ddl="./data/scores.yaml") send("guidelines=", get_guidelines(ddl)) end |
Instance Attribute Details
#guidelines ⇒ Object
Returns the value of attribute guidelines.
5 6 7 |
# File 'lib/html_compilation/classes/struct_classes/score_collection.rb', line 5 def guidelines @guidelines end |
Instance Method Details
#get_guidelines(ddl) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/html_compilation/classes/struct_classes/score_collection.rb', line 11 def get_guidelines(ddl) output = [] collections = read_yaml(ddl, "GUIDELINES") collections.each do |key, value| score = read_yaml(ddl, "SCORES")[key] value.each do |guideline| temp = ScoreElement.new(key, score, guideline) output.push(temp) end end output end |