Class: Bosh::Cli::Versions::ReleaseVersionsIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/versions/release_versions_index.rb

Instance Method Summary collapse

Constructor Details

#initialize(versions_index) ⇒ ReleaseVersionsIndex


4
5
6
# File 'lib/cli/versions/release_versions_index.rb', line 4

def initialize(versions_index)
  @versions_index = versions_index
end

Instance Method Details

#latest_versionObject


8
9
10
11
12
# File 'lib/cli/versions/release_versions_index.rb', line 8

def latest_version
  version_strings = @versions_index.version_strings
  return nil if version_strings.empty?
  Bosh::Common::Version::ReleaseVersionList.parse(version_strings).latest
end

#versionsObject


14
15
16
# File 'lib/cli/versions/release_versions_index.rb', line 14

def versions
  Bosh::Common::Version::ReleaseVersionList.parse(@versions_index.version_strings)
end