Class: Eaternet::Lives_1_0::Legend
- Inherits:
-
ValidatedObject
- Object
- ValidatedObject
- Eaternet::Lives_1_0::Legend
- Defined in:
- lib/eaternet/lives_1_0/legend.rb
Overview
Legends are mappings from score ranges to human-readable descriptions of those scores. Municipalities can use these to communicate the way scores are traditionally presented. For example, 0-60 may map to ‘Fail’ or 95-100 may map to ‘A+’. The provided ranges in #minimum_score and #maximum_score must cover the entire 0-100 span without overlap. For scores at the edge of two ranges, the greater range will be used. For example, if 80-90 is a ‘B’ and 90-100 is an ‘A’, a score of 90 would be an ‘A’. These are optional.
Instance Attribute Summary collapse
-
#description ⇒ String
Formatted version of the score in the format typically presented by the municipality.
-
#maximum_score ⇒ Integer
Maximum score that can be classified with this description.
-
#minimum_score ⇒ Integer
Minimum score that can be classified with this description.
Method Summary
Methods inherited from ValidatedObject
#check_validations!, #initialize
Constructor Details
This class inherits a constructor from Eaternet::ValidatedObject
Instance Attribute Details
#description ⇒ String
Formatted version of the score in the format typically presented by the municipality. For example ‘A’ or ‘Pass’.
35 36 37 |
# File 'lib/eaternet/lives_1_0/legend.rb', line 35 def description @description end |
#maximum_score ⇒ Integer
Maximum score that can be classified with this description.
27 28 29 |
# File 'lib/eaternet/lives_1_0/legend.rb', line 27 def maximum_score @maximum_score end |
#minimum_score ⇒ Integer
Minimum score that can be classified with this description.
20 21 22 |
# File 'lib/eaternet/lives_1_0/legend.rb', line 20 def minimum_score @minimum_score end |