lib/head_music/octave.rb in head_music-0.5.2 vs lib/head_music/octave.rb in head_music-0.5.3
- old
+ new
@@ -6,9 +6,10 @@
MATCHER = /(-?\d+)$/
def self.get(identifier)
from_number(identifier) || from_name(identifier) || default
end
+ singleton_class.send(:alias_method, :[], :get)
def self.from_number(identifier)
return nil unless identifier.to_s == identifier.to_i.to_s
return nil unless (-2..12).include?(identifier.to_i)
@octaves ||= {}