lib/coltrane/roman_chord.rb in coltrane-1.0.2 vs lib/coltrane/roman_chord.rb in coltrane-1.0.11

- old
+ new

@@ -1,14 +1,11 @@ -# frozen_string_literal: true - module Coltrane - # It deals with chords in roman notation class RomanChord DIGITS = { 'I' => 1, - 'V' => 5 - }.freeze + 'V' => 5, + } def initialize(scale, roman_numeral) @scale = scale @roman_numeral = roman_numeral end @@ -27,13 +24,13 @@ memo + (DIGITS[r] || 0) + (DIGITS[r.swapcase] || 0) end end def quality - ChordQuality.new(name: major? ? 'M' : 'm') + ChordQuality.new(name: is_major? ? 'M' : 'm') end - def major? + def is_major? @roman_numeral[0] =~ /[[:upper]]/ end end -end +end \ No newline at end of file