# File lib/deltacloud/drivers/exceptions.rb, line 122 def initialize(conditions, &block) @conditions = conditions instance_eval(&block) if block_given? self end
Condition can be class or regexp
# File lib/deltacloud/drivers/exceptions.rb, line 142 def any?(e) @conditions.each do |c| return true if c.class == Class && e.class == c return true if c.class == Regexp && (e.class.name =~ c or e.message =~ c) end return false end
# File lib/deltacloud/drivers/exceptions.rb, line 136 def exception(handler) self.handler = handler end