Class: Etcenv::DockerenvFile
- Inherits:
-
Object
- Object
- Etcenv::DockerenvFile
- Defined in:
- lib/etcenv/dockerenv_file.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env) ⇒ DockerenvFile
constructor
A new instance of DockerenvFile.
- #lines ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(env) ⇒ DockerenvFile
Returns a new instance of DockerenvFile.
5 6 7 |
# File 'lib/etcenv/dockerenv_file.rb', line 5 def initialize(env) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/etcenv/dockerenv_file.rb', line 9 def env @env end |
Instance Method Details
#lines ⇒ Object
11 12 13 |
# File 'lib/etcenv/dockerenv_file.rb', line 11 def lines env.map { |k,v| "#{k}=#{v}" } end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/etcenv/dockerenv_file.rb', line 15 def to_s lines.join(?\n) + ?\n end |