Class: Eaternet::Lives_1_0::Legend

Inherits:
ValidatedObject show all
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

Method Summary

Methods inherited from ValidatedObject

#check_validations!, #initialize

Constructor Details

This class inherits a constructor from Eaternet::ValidatedObject

Instance Attribute Details

#descriptionString

Formatted version of the score in the format typically presented by the municipality. For example ‘A’ or ‘Pass’.

Returns:

  • (String)

Required:

  • Yes


35
36
37
# File 'lib/eaternet/lives_1_0/legend.rb', line 35

def description
  @description
end

#maximum_scoreInteger

Maximum score that can be classified with this description.

Returns:

  • (Integer)

Required:

  • Yes


27
28
29
# File 'lib/eaternet/lives_1_0/legend.rb', line 27

def maximum_score
  @maximum_score
end

#minimum_scoreInteger

Minimum score that can be classified with this description.

Returns:

  • (Integer)

Required:

  • Yes


20
21
22
# File 'lib/eaternet/lives_1_0/legend.rb', line 20

def minimum_score
  @minimum_score
end