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



296
297
298
299
300
# File 'lib/blower/context.rb', line 296

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

#to_sObject



283
284
285
286
287
# File 'lib/blower/context.rb', line 283

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

#values_map!Object



289
290
291
292
293
294
# File 'lib/blower/context.rb', line 289

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