Adds .get_by_name to the including class.
8 9 10 11 12 13
# File 'lib/head_music/named.rb', line 8 def get_by_name(name) name = name.to_s @instances ||= {} key = HeadMusic::Utilities::HashKey.for(name) @instances[key] ||= new(name) end