Sha256: 4e1df0cf9f2742ae14280017095200731057dddb031bab52a44bee675b0796f4

Contents?: true

Size: 357 Bytes

Versions: 12

Compression:

Stored size: 357 Bytes

Contents

# frozen_string_literal: true
module Values
  # Users rate their mood
  class Mood
    def self.from_rating(rating)
      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/mood.rb
think_feel_do_engine-3.22.8 app/models/values/mood.rb
think_feel_do_engine-3.22.7 app/models/values/mood.rb
think_feel_do_engine-3.22.6 app/models/values/mood.rb
think_feel_do_engine-3.22.5 app/models/values/mood.rb
think_feel_do_engine-3.22.4 app/models/values/mood.rb
think_feel_do_engine-3.22.2 app/models/values/mood.rb
think_feel_do_engine-3.22.1 app/models/values/mood.rb
think_feel_do_engine-3.22.0 app/models/values/mood.rb
think_feel_do_engine-3.21.2 app/models/values/mood.rb
think_feel_do_engine-3.21.1 app/models/values/mood.rb
think_feel_do_engine-3.21.0 app/models/values/mood.rb