class Uke class Chord attr_reader :name, :positions, :fingers def initialize(line) parts = line.split(/\s{2,}/).map { |part| part.split(',') } @name = parts[0].join.tr(' ', '') @positions = parts[1].map(&:to_i) @fingers = parts[2] && parts[2].map(&:to_i) end end CHORDS_RAW = <