lib/head_music/style/analysis.rb in head_music-0.14.8 vs lib/head_music/style/analysis.rb in head_music-0.16.0

- old
+ new

@@ -7,19 +7,24 @@ @ruleset = ruleset @subject = subject end def messages - annotations.reject(&:perfect?).map(&:message) + annotations.reject(&:adherent?).map(&:message) end + alias_method :annotation_messages, :messages def annotations @annotations ||= @ruleset.analyze(subject) end def fitness return 1.0 if annotations.length == 0 fitness_scores.inject(:+).to_f / fitness_scores.length + end + + def adherent? + fitness == 1 end private def fitness_scores