Sha256: ac1e8dfc868a3f472e9b5c2ba6b6a0ac3271173ce2616d1955835dbb214d60c7

Contents?: true

Size: 458 Bytes

Versions: 9

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

# Module for style guidelines.
module HeadMusic::Style::Guidelines; end

# A counterpoint guideline
class HeadMusic::Style::Guidelines::UpToFourteenNotes < HeadMusic::Style::Annotation
  MAXIMUM_NOTES = 14

  MESSAGE = "Write up to fourteen notes."

  def marks
    HeadMusic::Style::Mark.for_each(notes[MAXIMUM_NOTES..]) if overage.positive?
  end

  private

  def overage
    [notes.length - MAXIMUM_NOTES, 0].max
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-4.0.1 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-4.0.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-3.0.1 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-3.0.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-2.0.1 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-2.0.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-1.0.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-0.29.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb
head_music-0.28.0 lib/head_music/style/guidelines/up_to_fourteen_notes.rb