Class: HeadMusic::Style::Guidelines::MinimumNotes

Inherits:
MinimumThreshold show all
Defined in:
lib/head_music/style/guidelines/minimum_notes.rb

Overview

Flags a melody with fewer than the required number of notes. Configure the threshold with the factory, e.g. MinimumNotes.with(8).

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from HeadMusic::Style::Guideline

Class Method Details

.template_values(config) ⇒ Object

The count comes from the configuration or the class default -- never from config alone, which is empty for the unconfigured case.



13
14
15
16
# File 'lib/head_music/style/guidelines/minimum_notes.rb', line 13

def self.template_values(config)
  count = config.fetch(:minimum) { MINIMUM }
  {count: count, number: HeadMusic::Style::Template.number_word(count)}
end

Instance Method Details

#actual_countObject (private)



20
21
22
# File 'lib/head_music/style/guidelines/minimum_notes.rb', line 20

def actual_count
  notes.length
end

#marksObject



7
8
9
# File 'lib/head_music/style/guidelines/minimum_notes.rb', line 7

def marks
  placements.empty? ? no_placements_mark : deficiency_mark
end