Sha256: b4603415750dfd2f1cb7fd0b8e302904533826800d356ca23a2b302024d01ebf
Contents?: true
Size: 471 Bytes
Versions: 7
Compression:
Stored size: 471 Bytes
Contents
# frozen_string_literal: true 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 def to_h @letter end def to_json(*a) to_h.to_json(*a) end end end
Version data entries
7 entries across 7 versions & 1 rubygems