Sha256: 7e9eb7ad9700964886d0ab3917f551b45f74ca7a576bc61dc6bf6333b39c5ff6

Contents?: true

Size: 439 Bytes

Versions: 12

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true
module Values
  # Participants rate their emotion with an intensity
  class EmotionalRating
    def self.from_rating(rating)
      return "Not answered" if rating.nil?
      if rating < 5
        new("Bad")
      elsif rating == 5
        new("Neither")
      else
        new("Good")
      end
    end

    def initialize(label)
      @label = label
    end

    def to_s
      @label.to_s
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.8 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.7 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.6 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.5 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.4 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.2 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.1 app/models/values/emotional_rating.rb
think_feel_do_engine-3.22.0 app/models/values/emotional_rating.rb
think_feel_do_engine-3.21.2 app/models/values/emotional_rating.rb
think_feel_do_engine-3.21.1 app/models/values/emotional_rating.rb
think_feel_do_engine-3.21.0 app/models/values/emotional_rating.rb