lib/inch/evaluation/grade.rb in inch-0.3.3 vs lib/inch/evaluation/grade.rb in inch-0.3.4.rc1
- old
+ new
@@ -1,23 +1,31 @@
module Inch
module Evaluation
+ # Grades are human-friendly representations of scores.
+ #
class Grade
extend Utils::ReadWriteMethods
rw_methods %w(scores label color bg_color)
def initialize(symbol)
@symbol = symbol
end
+ # Updates the grade's configuration with the given block
+ #
+ # @param block [Proc]
+ # @return [void]
def update(&block)
instance_eval(&block)
end
+ # @return [Symbol] the grade as a symbol (e.g. +:A+)
def to_sym
@symbol
end
+ # @return [String] the grade as a string (e.g. "A")
def to_s
@symbol.to_s
end
class << self