Sha256: 967ce3b8b6c29511d5f016b10f5c23c6f3ef4d6bb4047a3b363f9e19471d1425

Contents?: true

Size: 427 Bytes

Versions: 55

Compression:

Stored size: 427 Bytes

Contents

module Values
  # A value that might be assigned to an Activity.
  class Pleasure
    def self.from_intensity(intensity)
      return "Not answered" if intensity.nil?
      if intensity < 4
        new("Not Fun")
      elsif intensity < 7
        new("Kind of fun")
      else
        new("Really fun")
      end
    end

    def initialize(label)
      @label = label
    end

    def to_s
      @label.to_s
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/models/values/pleasure.rb
think_feel_do_engine-3.19.8 app/models/values/pleasure.rb
think_feel_do_engine-3.19.7 app/models/values/pleasure.rb
think_feel_do_engine-3.19.6 app/models/values/pleasure.rb
think_feel_do_engine-3.19.5 app/models/values/pleasure.rb
think_feel_do_engine-3.19.4 app/models/values/pleasure.rb
think_feel_do_engine-3.19.3 app/models/values/pleasure.rb
think_feel_do_engine-3.19.2 app/models/values/pleasure.rb
think_feel_do_engine-3.19.1 app/models/values/pleasure.rb
think_feel_do_engine-3.19.0 app/models/values/pleasure.rb
think_feel_do_engine-3.18.0 app/models/values/pleasure.rb
think_feel_do_engine-3.17.2 app/models/values/pleasure.rb
think_feel_do_engine-3.17.1 app/models/values/pleasure.rb
think_feel_do_engine-3.17.0 app/models/values/pleasure.rb
think_feel_do_engine-3.16.3 app/models/values/pleasure.rb
think_feel_do_engine-3.16.2 app/models/values/pleasure.rb
think_feel_do_engine-3.16.1 app/models/values/pleasure.rb
think_feel_do_engine-3.15.7 app/models/values/pleasure.rb
think_feel_do_engine-3.16.0 app/models/values/pleasure.rb
think_feel_do_engine-3.15.6 app/models/values/pleasure.rb