I know there some object has nil? method, I want to know is there some method with nil?
Asked
Active
Viewed 90 times
-2
-
are you asking "How do I test an object to see if it is Nil?" – Mitch Wheat Oct 29 '10 at 08:38
-
I guess he's asking for `nil!` method...Note for `!`... – PeterWong Oct 29 '10 at 08:46
5 Answers
0
There is a similar answered post here: a-concise-explanation-of-nil-v-empty-v-blank-in-ruby-on-rails
Summarizing:
If you are using rails (not just ruby) there are three methods in your toolkit: .nil?, .empty? and .blank?
Follow the link to see the good description