Sha256: 1244ee7194c181a163a309c5711bf417f9e9c4b9ea6c77c8b2d2b31245407d91

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 Bytes

Contents

# Representation of a bar in a composition
# Encapsulates meter and key signature changes
class HeadMusic::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].reject(&:nil?).join(' ')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
head_music-0.13.2 lib/head_music/bar.rb