Class: DockerfileRB::Expose
- Inherits:
-
Object
- Object
- DockerfileRB::Expose
- Defined in:
- lib/dockerfile-rb/expose.rb
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
Instance Method Summary collapse
-
#initialize(port, protocol) ⇒ Expose
constructor
A new instance of Expose.
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
#port ⇒ Object (readonly)
Returns the value of attribute port.
3 4 5 |
# File 'lib/dockerfile-rb/expose.rb', line 3 def port @port end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
3 4 5 |
# File 'lib/dockerfile-rb/expose.rb', line 3 def protocol @protocol end |