Sha256: 44991403bbe2b2f9d4ad588745bcb1800229b79a5f75e85e116ffafa52ddb563
Contents?: true
Size: 730 Bytes
Versions: 16
Compression:
Stored size: 730 Bytes
Contents
module Inch module Evaluation class Grade extend Utils::ReadWriteMethods rw_methods %w(scores label color bg_color) def initialize(symbol) @symbol = symbol end def update(&block) instance_eval(&block) end def to_sym @symbol end def to_s @symbol.to_s end class << self attr_reader :grade_map def all @grade_map ||= {} @grade_map.values end def grade(symbol, &block) @grade_map ||= {} @grade_map[symbol] ||= Grade.new(symbol) @grade_map[symbol].update(&block) if block @grade_map[symbol] end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems