Method: VirtualBox::AbstractModel::VersionMatcher#split_version

Defined in:
lib/virtualbox/abstract_model/version_matcher.rb

#split_version(version) ⇒ Array

Splits a version string into a two-item array with the parts of the version, respectively. If the version has more than two parts, the rest are ignored.

Parameters:

  • version (String)

Returns:

  • (Array)


27
28
29
30
31
# File 'lib/virtualbox/abstract_model/version_matcher.rb', line 27

def split_version(version)
  version.split(/\./)[0,2]
rescue Exception
  []
end