nil?, empty?とblank?の違い-Ruby on Rails-[和訳]

hey, guys:)
nilとemptyとblankって一緒じゃないの?とふと疑問に思ってstack overflowで検索。。
なるほど〜,と思う説明があったので和訳してみる。この記事は質問者に770,回答者に1054のいいねがついているので良記事に違いない。
それでは和訳してみる。

–質問–

I find myself repeatedly looking for a clear definition of the differences of nil?, blank?, and empty? in Ruby on Rails.

私は何回もRuby on Railsnil?,blank?とempty?について明白な定義がないか探している。

–回答–

.nil? can be used on any object and is true if the object is nil.

.nil?はどんなオブジェクトに使えて、オブジェクトがnilならtrueを返す。

.empty? can be used on strings, arrays and hashes and returns true if:

.empty?は文字列(string)、配列(array)やハッシュ(hash)に使えて、例えば次のような時はtrueを返す;

String length == 0  
Array length == 0
Hash length == 0  

Running .empty? on something that is nil will throw a NoMethodError.

何かnilのものに.empty?をを使うとNoMethodErrorになってしまう。

That is where .blank? comes in.

その場合はblank?が使われるところだ。

It is implemented by Rails and will operate on any object as well as work like .empty? on strings, arrays and hashes.

.empty?が文字列、配列やハッシュで使われるのと同じようにRailsで実装できる。

nil.blank? == true
false.blank? == true
[].blank? == true
{}.blank? == true
"".blank? == true
5.blank? == false
0.blank? == false

.blank? also evaluates true on strings which are non-empty but contain only whitespace:

.blank?は空白スペースの文字列にtrueを返す:

"  ".blank? == true
"  ".empty? == false

Rails also provides .present?, which returns the negation of .blank?.

Rails.blank?の否定を返す.present?を用意している。

Array gotcha: blank? will return false even if all elements of an array are blank.

.blank?は配列のすべての要素が空の場合であってもfalseを返す。

To determine blankness in this case, use all? with blank?, for example:

この場合、空か判断するにはall?blank?を一緒に使おう、例えば:

[ nil, '' ].blank? == false
[ nil, '' ].all? &:blank? == true 

これは覚えなきゃいけないのかな? 使う時にわからなくなったらまたこの記事をみるとしよう!
この記事のリンクに素敵な表があったからよかったらチェックしてみてね!
see you!!

A concise explanation of nil v. empty v. blank in Ruby on Rails - Stack Overflow