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

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.



7
8
9
# File 'lib/gitlab/triage/resource/instance_version.rb', line 7

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

Instance Method Details

#responseObject (private)



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

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

#revisionObject



19
20
21
# File 'lib/gitlab/triage/resource/instance_version.rb', line 19

def revision
  response[:revision]
end

#versionObject



11
12
13
# File 'lib/gitlab/triage/resource/instance_version.rb', line 11

def version
  response[:version]
end

#version_shortObject



15
16
17
# File 'lib/gitlab/triage/resource/instance_version.rb', line 15

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