Class: Dapp::Deployment::Config::Directive::Expose::Port

Inherits:
Base show all
Defined in:
lib/dapp/deployment/config/directive/expose.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#hostname_pattern

Methods inherited from Config::Directive::Base

#clone, #encode_with

Constructor Details

#initialize(number, dapp:, &blk) ⇒ Port

Returns a new instance of Port.



34
35
36
37
38
# File 'lib/dapp/deployment/config/directive/expose.rb', line 34

def initialize(number, dapp:, &blk)
  self._number = number
  @_protocol = 'TCP'
  super(dapp: dapp, &blk)
end

Instance Attribute Details

#_numberObject

Returns the value of attribute _number.



32
33
34
# File 'lib/dapp/deployment/config/directive/expose.rb', line 32

def _number
  @_number
end

#_protocolObject (readonly)

Returns the value of attribute _protocol.



32
33
34
# File 'lib/dapp/deployment/config/directive/expose.rb', line 32

def _protocol
  @_protocol
end

#_targetObject (readonly)

Returns the value of attribute _target.



32
33
34
# File 'lib/dapp/deployment/config/directive/expose.rb', line 32

def _target
  @_target
end

Instance Method Details

#target(number) ⇒ Object



40
41
42
# File 'lib/dapp/deployment/config/directive/expose.rb', line 40

def target(number)
  @_target = define_number(number, :unsupported_target_number)
end

#tcpObject



44
45
46
# File 'lib/dapp/deployment/config/directive/expose.rb', line 44

def tcp
  @_protocol = 'TCP'
end

#udpObject



48
49
50
# File 'lib/dapp/deployment/config/directive/expose.rb', line 48

def udp
  @_protocol = 'UDP'
end