Class: JazzModel::ChordSymbol

Inherits:
Base
  • Object
show all
Defined in:
lib/jazz_model/chord_symbol.rb

Overview

A standard chord symbol (if there is such a thing…). Several chord symbols can be associated with a given chord, and each chord can be designated case_sensitive or not, to handle cases such as M representing Major and m representing minor. Act as a list to facilitate preference ordering. May abandong this in the future to prefer a simple primary designation.

Associations

  • chord - Chord associated with the chord symbol.

Class Method Summary collapse

Methods inherited from Base

load_definitions

Class Method Details

.resolve(symbol) ⇒ Object Also known as: []

Finds a chord symbol



18
19
20
21
22
# File 'lib/jazz_model/chord_symbol.rb', line 18

def resolve(symbol)
  self.all.detect do |cs|
    cs.case_sensitive? ? (cs.name == symbol) : (cs.name.downcase == symbol.downcase)
  end
end