Sha256: d044c82f0a1aa73dbee4479fd901a135b1c6effedaf83df2e1f33d1a1b761c00

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

# frozen_string_literal: true

# Module for Annotations.
module HeadMusic::Style::Annotations; end

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

  MESSAGE = 'Write up to fourteen notes.'

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

  private

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
head_music-0.19.0 lib/head_music/style/annotations/up_to_fourteen_notes.rb
head_music-0.18.0 lib/head_music/style/annotations/up_to_fourteen_notes.rb