Sha256: 99d8d322f8fa2bfd28ec147a1e4dc211ddf08657a344d7bf4af8d9b4f6636d2c

Contents?: true

Size: 630 Bytes

Versions: 10

Compression:

Stored size: 630 Bytes

Contents

class HeadMusic::Instrument
  include HeadMusic::NamedRudiment

  INSTRUMENTS = {
    violin: {
      name: "violin",
      family: :string,
      default_clef: :treble
    },
    piano: {
      name: "piano",
      family: :string,
      default_system: [:treble, :bass]
    }
  }

  def self.get(name)
    get_by_name(name)
  end

  def initialize(name)
    @name = name.to_s
  end

  def data
    @data ||= INSTRUMENTS[hash_key]
  end

  def family
    data[:family]
  end

  def default_system
    data[:default_system]
  end

  def default_clef
    data[:default_clef]
  end

  def ==(other)
    to_s == other.to_s
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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