lib/pragma/operation/defaults.rb in pragma-1.1.1 vs lib/pragma/operation/defaults.rb in pragma-1.1.2
- old
+ new
@@ -67,9 +67,14 @@
name_parts = name.split('::')
(name_parts[0..-3] << 'Contract' << name_parts.last).join('::')
end
def class_exists?(klass)
+ begin
+ Object.const_get(klass)
+ rescue NameError
+ end
+
Object.const_defined?(klass)
end
end
end
end