Class: NilClass
Instance Method Summary collapse
-
#empty? ⇒ Boolean
A simple routing method in case your empty array is actually nil If you’re calling empty?, you care if there is data in there, not if the object is actually an array nil is obviously empty, so return true instead of NoMethodError.
Instance Method Details
#empty? ⇒ Boolean
A simple routing method in case your empty array is actually nil If you’re calling empty?, you care if there is data in there, not if the object is actually an array nil is obviously empty, so return true instead of NoMethodError
7 8 9 |
# File 'lib/more_ruby/nilclass.rb', line 7 def empty? true end |