Class: Gitlab::Ci::Config::Entry::Port

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/entry/port.rb

Overview

Entry that represents a configuration of an Image Port.

Constant Summary collapse

ALLOWED_KEYS =
%i[number protocol name].freeze

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #description, #key, #metadata, #parent

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Validatable

#compose!, #errors, included, #validate, #validator

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, aspects, #compose!, default, #descendants, #errors, #hash?, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #string?, #valid?, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Instance Method Details

#nameObject


32
33
34
# File 'lib/gitlab/ci/config/entry/port.rb', line 32

def name
  value[:name]
end

#numberObject


24
25
26
# File 'lib/gitlab/ci/config/entry/port.rb', line 24

def number
  value[:number]
end

#protocolObject


28
29
30
# File 'lib/gitlab/ci/config/entry/port.rb', line 28

def protocol
  value[:protocol]
end

#valueObject


36
37
38
39
40
41
# File 'lib/gitlab/ci/config/entry/port.rb', line 36

def value
  return { number: @config } if integer?
  return @config if hash?

  {}
end