Sha256: c93f37293a069c8736690331e4f90a4b2478df2174c9e2031fe6519285608bee

Contents?: true

Size: 296 Bytes

Versions: 11

Compression:

Stored size: 296 Bytes

Contents

module Kosher
  class Condition < Struct.new(:grade)
    def kosher?
      grade <= threshold
    end

    def new?
      grade == 1
    end

    def threshold
      @threshold ||= 4
    end

    def threshold=(grade)
      @threshold = grade
    end

    def used?
      !new?
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kosher-0.2.11 lib/kosher/condition.rb
kosher-0.2.10 lib/kosher/condition.rb
kosher-0.2.9 lib/kosher/condition.rb
kosher-0.2.8 lib/kosher/condition.rb
kosher-0.2.7 lib/kosher/condition.rb
kosher-0.2.6 lib/kosher/condition.rb
kosher-0.2.5 lib/kosher/condition.rb
kosher-0.2.4 lib/kosher/condition.rb
kosher-0.2.3 lib/kosher/condition.rb
kosher-0.2.2 lib/kosher/condition.rb
kosher-0.2.1 lib/kosher/condition.rb