Class: Etcenv::DotenvFile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ DotenvFile

Returns a new instance of DotenvFile.



5
6
7
# File 'lib/etcenv/dotenv_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/dotenv_file.rb', line 9

def env
  @env
end

Instance Method Details

#linesObject



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

def lines
  env.map { |k, v| make_dotenv_line(k, v) }
end

#to_sObject



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

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