mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
27 lines
387 B
Ruby
27 lines
387 B
Ruby
class SubcategoryCardPresenter
|
|
attr_reader :name
|
|
|
|
def initialize(name:, scale:, score:)
|
|
@name = name
|
|
@scale = scale
|
|
@score = score
|
|
end
|
|
|
|
def harvey_ball_icon
|
|
"#{zone.type}-harvey-ball"
|
|
end
|
|
|
|
def color
|
|
zone.type.to_s
|
|
end
|
|
|
|
def insufficient_data?
|
|
zone.type == :insufficient_data
|
|
end
|
|
|
|
private
|
|
|
|
def zone
|
|
@scale.zone_for_score(@score)
|
|
end
|
|
end
|