Class: Etcenv::DotenvFile
- Inherits:
-
Object
- Object
- Etcenv::DotenvFile
- Defined in:
- lib/etcenv/dotenv_file.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env) ⇒ DotenvFile
constructor
A new instance of DotenvFile.
- #lines ⇒ Object
- #to_s ⇒ Object
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
#env ⇒ Object (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
#lines ⇒ Object
11 12 13 |
# File 'lib/etcenv/dotenv_file.rb', line 11 def lines env.map { |k, v| make_dotenv_line(k, v) } end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/etcenv/dotenv_file.rb', line 15 def to_s lines.join(?\n) + ?\n end |