Class: Ironment::Populator

Inherits:
Object
  • Object
show all
Defined in:
lib/ironment/populator.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Populator

Returns a new instance of Populator.



3
4
5
# File 'lib/ironment/populator.rb', line 3

def initialize(options = {})
  @env = options[:env] || ENV
end

Instance Method Details

#populate_with(runcom) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/ironment/populator.rb', line 7

def populate_with(runcom)
  enum = runcom.each_pair

  loop do
    @env.[]= *enum.next
  end
end