Class: Blower::Context::HostHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/blower/context.rb

Instance Method Summary collapse

Instance Method Details

#stash(key) ⇒ Object


315
316
317
318
319
# File 'lib/blower/context.rb', line 315

def stash (key)
  each do |host, data|
    host[key] = data.strip if data
  end
end

#to_sObject


302
303
304
305
306
# File 'lib/blower/context.rb', line 302

def to_s
  map do |host, data|
    "#{host.name.blue}\n" + data.strip.to_s.gsub(/^/, "  ")
  end.join("\n")
end

#values_map!Object


308
309
310
311
312
313
# File 'lib/blower/context.rb', line 308

def values_map!
  each do |host, data|
    self[host] = yield(host, data)
  end
  self
end