def [](version)
      return versions.values.last unless version
      detected = versions.detect { |v,_| version.start_with?(v) }
      raise ArgumentError, 'unsupported version %p' % version unless detected
      detected.last
    end
def [](version)
      return versions.values.last unless version
      detected = versions.detect { |v,_| version.start_with?(v) }
      raise ArgumentError, 'unsupported version %p' % version unless detected
      detected.last
    end
Resolve a subclass for a given version string.
 @!visibility private