Class: Values::EmotionalRating
- Inherits:
-
Object
- Object
- Values::EmotionalRating
- Defined in:
- app/models/values/emotional_rating.rb
Overview
Participants rate their emotion with an intensity
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(label) ⇒ EmotionalRating
constructor
A new instance of EmotionalRating.
- #to_s ⇒ Object
Constructor Details
#initialize(label) ⇒ EmotionalRating
Returns a new instance of EmotionalRating.
16 17 18 |
# File 'app/models/values/emotional_rating.rb', line 16 def initialize(label) @label = label end |
Class Method Details
.from_rating(rating) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/models/values/emotional_rating.rb', line 5 def self.() return "Not answered" if .nil? if < 5 new("Bad") elsif == 5 new("Neither") else new("Good") end end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'app/models/values/emotional_rating.rb', line 20 def to_s @label.to_s end |