Sha256: f37f9018309d42df6827e448a5e136edb17a63cff602e864e7ce9ba1ed1e1401

Contents?: true

Size: 513 Bytes

Versions: 23

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

# 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

23 entries across 23 versions & 1 rubygems

Version Path
head_music-0.27.0 lib/head_music/content/bar.rb
head_music-0.26.3 lib/head_music/content/bar.rb
head_music-0.26.2 lib/head_music/content/bar.rb
head_music-0.26.1 lib/head_music/content/bar.rb
head_music-0.26.0 lib/head_music/content/bar.rb
head_music-0.25.0 lib/head_music/content/bar.rb
head_music-0.24.5 lib/head_music/content/bar.rb
head_music-0.24.4 lib/head_music/content/bar.rb
head_music-0.24.3 lib/head_music/content/bar.rb
head_music-0.24.2 lib/head_music/content/bar.rb
head_music-0.24.1 lib/head_music/content/bar.rb
head_music-0.24.0 lib/head_music/content/bar.rb
head_music-0.23.4 lib/head_music/content/bar.rb
head_music-0.23.3 lib/head_music/content/bar.rb
head_music-0.23.2 lib/head_music/content/bar.rb
head_music-0.23.1 lib/head_music/content/bar.rb
head_music-0.23.0 lib/head_music/content/bar.rb
head_music-0.22.0 lib/head_music/content/bar.rb
head_music-0.20.0 lib/head_music/content/bar.rb
head_music-0.19.2 lib/head_music/content/bar.rb