lib/ensure_it/config.rb in ensure_it-0.1.3 vs lib/ensure_it/config.rb in ensure_it-0.1.4

- old
+ new

@@ -8,9 +8,18 @@ def self.errors=(value) value = value.to_sym if value.is_a?(String) @errors = ERRORS.include?(value) ? value : ERRORS.first end + + def self.error_class(value = nil) + value.nil? ? @error_class ||= EnsureIt::Error : self.error_class = value + end + + def self.error_class=(value) + return unless value.is_a?(Class) && value <= Exception + @error_class = value + end end def self.config Config end