Extended NilClass with empty? method.
This commit is contained in:
parent
d54bb4fa05
commit
e0ec2fbd12
1 changed files with 17 additions and 0 deletions
17
lib/core_ext/nil_class.rb
Normal file
17
lib/core_ext/nil_class.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
class NilClass
|
||||||
|
|
||||||
|
=begin
|
||||||
|
|
||||||
|
result = nil.empty?
|
||||||
|
|
||||||
|
result
|
||||||
|
|
||||||
|
true
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
def empty?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue