Sha256: f71f061dbb6b7c33be9b1c535cbc429d9b2ded424e9a10ead1d1362a1d451a78

Contents?: true

Size: 460 Bytes

Versions: 21

Compression:

Stored size: 460 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..-1]) if overage.positive?
  end

  private

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
head_music-0.19.1 lib/head_music/style/guidelines/up_to_fourteen_notes.rb