Sha256: 29fa3430f2bbcc0ef16cc4ea0feaf76045bed21982ca45834ade2bf5dbfe315e

Contents?: true

Size: 482 Bytes

Versions: 9

Compression:

Stored size: 482 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].compact.join(' ')
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-0.17.0 lib/head_music/bar.rb
head_music-0.16.2 lib/head_music/bar.rb
head_music-0.16.0 lib/head_music/bar.rb
head_music-0.14.8 lib/head_music/bar.rb
head_music-0.14.7 lib/head_music/bar.rb
head_music-0.14.5 lib/head_music/bar.rb
head_music-0.14.4 lib/head_music/bar.rb
head_music-0.14.2 lib/head_music/bar.rb
head_music-0.14.1 lib/head_music/bar.rb