From e0ec2fbd12875ae0aece8c1e8958def1b9d7509c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 19 Feb 2016 23:34:57 +0100 Subject: [PATCH] Extended NilClass with empty? method. --- lib/core_ext/nil_class.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/core_ext/nil_class.rb diff --git a/lib/core_ext/nil_class.rb b/lib/core_ext/nil_class.rb new file mode 100644 index 000000000..4b4a8878a --- /dev/null +++ b/lib/core_ext/nil_class.rb @@ -0,0 +1,17 @@ +class NilClass + +=begin + + result = nil.empty? + +result + + true + +=end + + def empty? + true + end + +end