Sha256: d544565f95459f3251ae9e12beb1b1873073f139b2a91c5719743d6a8139ebce

Contents?: true

Size: 585 Bytes

Versions: 7

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

# A module for musical content
module HeadMusic::Content; end

# Representation of a bar in a composition
# Encapsulates meter and key signature changes
class HeadMusic::Content::Bar
  attr_reader :composition
  attr_accessor :key_signature, :meter

  def initialize(composition, key_signature: nil, meter: nil)
    @composition = composition
    @key_signature = HeadMusic::KeySignature.get(key_signature) if key_signature
    @meter = HeadMusic::Meter.get(meter) if meter
  end

  def to_s
    ["Bar", key_signature, meter].compact.join(" ")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
head_music-4.0.1 lib/head_music/content/bar.rb
head_music-4.0.0 lib/head_music/content/bar.rb
head_music-3.0.1 lib/head_music/content/bar.rb
head_music-3.0.0 lib/head_music/content/bar.rb
head_music-2.0.1 lib/head_music/content/bar.rb
head_music-2.0.0 lib/head_music/content/bar.rb
head_music-1.0.0 lib/head_music/content/bar.rb