Sha256: ff0922f59ed23c1af893774838a7b99fba7e23a18716ef96e6d92e0ee34ecfe8
Contents?: true
Size: 484 Bytes
Versions: 26
Compression:
Stored size: 484 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(*options) to_h.to_json(*options) end end end
Version data entries
26 entries across 26 versions & 2 rubygems