(Memorandum) Explanation It is summarized so that it can be used immediately with a minimum. (Conclusion) If you remember either blank? or prresent?
When using ## empty? ** Used when you want to know if the contents are empty after satisfying the following conditions. ** ① Make sure there is a container ② The contents are not numbers, true or false
If the conditions ① and ② are not satisfied, NoMethodError will occur.
When using ## blank? Used when you want to know if the contents are empty or in the first place
irb(main):001:0> box = nil => nil irb(main):002:0> box.blank? => true
When using ## present? Used when you want to know that it exists and is not empty (synonym for !blank?)
irb(main):006:0> box = nil => nil irb(main):007:0> box.present? => false
I would like to know a little more, what should I do in this case? When
It is easy to understand because it covers the patterns in table format.