Sha256: 2f59132f5d3a5649399addf9ec41a2f9c5283b77c8087d59dcc2a31754ad7599

Contents?: true

Size: 355 Bytes

Versions: 10

Compression:

Stored size: 355 Bytes

Contents

module Rubycritic

  class Rating
    def self.from_cost(cost)
      if    cost <= 2  then new("A")
      elsif cost <= 4  then new("B")
      elsif cost <= 8  then new("C")
      elsif cost <= 16 then new("D")
      else new("F")
      end
    end

    def initialize(letter)
      @letter = letter
    end

    def to_s
      @letter
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubycritic-1.3.0 lib/rubycritic/core/rating.rb
rubycritic-1.2.1 lib/rubycritic/core/rating.rb
rubycritic-1.2.0 lib/rubycritic/core/rating.rb
rubycritic-1.1.1 lib/rubycritic/core/rating.rb
rubycritic-1.1.0 lib/rubycritic/core/rating.rb
rubycritic-1.0.2 lib/rubycritic/core/rating.rb
rubycritic-1.0.1 lib/rubycritic/core/rating.rb
rubycritic-1.0.0 lib/rubycritic/core/rating.rb
rubycritic-0.0.16 lib/rubycritic/core/rating.rb
rubycritic-0.0.15 lib/rubycritic/core/rating.rb