lib/head_music/style/analysis.rb in head_music-0.10.0 vs lib/head_music/style/analysis.rb in head_music-0.11.1
- old
+ new
@@ -4,10 +4,13 @@
attr_reader :ruleset, :subject, :annotations
def initialize(ruleset, subject)
@ruleset = ruleset
@subject = subject
- @annotations = @ruleset.analyze(subject)
+ end
+
+ def annotations
+ @annotations ||= @ruleset.analyze(subject)
end
def fitness
annotations.map(&:fitness).reduce(1, :*)
end