Class: InciScore::Score
- Inherits:
-
Object
- Object
- InciScore::Score
- Defined in:
- lib/inci_score/score.rb
Instance Attribute Summary collapse
-
#hazard ⇒ Object
readonly
Returns the value of attribute hazard.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(hazard, weight) ⇒ Score
constructor
A new instance of Score.
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
#hazard ⇒ Object (readonly)
Returns the value of attribute hazard.
5 6 7 |
# File 'lib/inci_score/score.rb', line 5 def hazard @hazard end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/inci_score/score.rb', line 5 def value @value end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
5 6 7 |
# File 'lib/inci_score/score.rb', line 5 def weight @weight end |