Class: DockerfileRB::Expose

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerfile-rb/expose.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port, protocol) ⇒ Expose

Returns a new instance of Expose.



4
5
6
7
8
9
10
11
# File 'lib/dockerfile-rb/expose.rb', line 4

def initialize(port, protocol)
  if port.match /\d/
    @port = port.to_i
    @protocol = (protocol || 'tcp').downcase
  else # port is a variable
    @port = port
  end
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/dockerfile-rb/expose.rb', line 3

def port
  @port
end

#protocolObject (readonly)

Returns the value of attribute protocol.



3
4
5
# File 'lib/dockerfile-rb/expose.rb', line 3

def protocol
  @protocol
end