Class: Etcenv::DockerenvFile

Inherits:
Object
  • Object
show all
Defined in:
lib/etcenv/dockerenv_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#envObject (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

#linesObject



11
12
13
# File 'lib/etcenv/dockerenv_file.rb', line 11

def lines
  env.map { |k,v| "#{k}=#{v}" }
end

#to_sObject



15
16
17
# File 'lib/etcenv/dockerenv_file.rb', line 15

def to_s
  lines.join(?\n) + ?\n
end