Exception: Chef::Exceptions::MultipleDscResourcesFound
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Chef::Exceptions::MultipleDscResourcesFound
- Defined in:
- lib/chef/exceptions.rb
Instance Attribute Summary collapse
-
#resources_found ⇒ Object
readonly
Returns the value of attribute resources_found.
Instance Method Summary collapse
-
#initialize(resources_found) ⇒ MultipleDscResourcesFound
constructor
A new instance of MultipleDscResourcesFound.
Constructor Details
#initialize(resources_found) ⇒ MultipleDscResourcesFound
Returns a new instance of MultipleDscResourcesFound.
511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/chef/exceptions.rb', line 511 def initialize(resources_found) @resources_found = resources_found matches_info = @resources_found.each do |r| if r["Module"].nil? "Resource #{r['Name']} was found in #{r['Module']['Name']}" else "Resource #{r['Name']} is a binary resource" end end super "Found multiple matching resources. #{matches_info.join("\n")}" end |
Instance Attribute Details
#resources_found ⇒ Object (readonly)
Returns the value of attribute resources_found.
510 511 512 |
# File 'lib/chef/exceptions.rb', line 510 def resources_found @resources_found end |