class InciScore::Score

Attributes

value[R]

Public Class Methods

new(hazard, weight) click to toggle source
# File lib/inci_score/score.rb, line 5
def initialize(hazard, weight)
  @hazard = hazard
  @weight = weight
  @value = compute
end

Private Instance Methods

compute() click to toggle source
# File lib/inci_score/score.rb, line 11
        def compute
  (@hazard - @weight).tap do |s|
    return 0.0 if s < 0
  end
end