Class: InciScore::Score

Inherits:
Object
  • Object
show all
Defined in:
lib/inci_score/score.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hazard, weight) ⇒ Score

Returns a new instance of Score.



7
8
9
10
11
12
# File 'lib/inci_score/score.rb', line 7

def initialize(hazard, weight)
  @hazard = hazard
  @weight = weight
  @value = compute
  freeze
end

Instance Attribute Details

#hazardObject (readonly)

Returns the value of attribute hazard.



5
6
7
# File 'lib/inci_score/score.rb', line 5

def hazard
  @hazard
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/inci_score/score.rb', line 5

def value
  @value
end

#weightObject (readonly)

Returns the value of attribute weight.



5
6
7
# File 'lib/inci_score/score.rb', line 5

def weight
  @weight
end