Class: Gitlab::Triage::Resource::InstanceVersion

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/triage/resource/instance_version.rb

Constant Summary

Constants inherited from Base

Base::CONFIDENTIAL_TEXT, Base::SOURCE_ERROR_MSG

Instance Attribute Summary

Attributes inherited from Base

#parent, #resource

Instance Method Summary collapse

Methods inherited from Base

#build_url, define_field, #expand_resource!, #network, #redact_confidential_attributes?, #resource_id, #resource_url, #source, #source_resource, #source_url, #url, #url_opts

Constructor Details

#initialize(**options) ⇒ InstanceVersion

Returns a new instance of InstanceVersion.



9
10
11
# File 'lib/gitlab/triage/resource/instance_version.rb', line 9

def initialize(**options)
  super({}, **options)
end

Instance Method Details

#responseObject (private)



28
29
30
31
32
33
# File 'lib/gitlab/triage/resource/instance_version.rb', line 28

def response
  @response ||=
    network.query_api_cached(
      "#{network.options.host_url}/api/#{network.options.api_version}/version")
      .first
end

#revisionObject



21
22
23
# File 'lib/gitlab/triage/resource/instance_version.rb', line 21

def revision
  response[:revision]
end

#versionObject



13
14
15
# File 'lib/gitlab/triage/resource/instance_version.rb', line 13

def version
  response[:version]
end

#version_shortObject



17
18
19
# File 'lib/gitlab/triage/resource/instance_version.rb', line 17

def version_short
  version[/^\d+\.\d+/]
end