Project

General

Profile

Feature #14136

Implement #empty? on more classes

Added by mikegee (Michael Gee) over 2 years ago. Updated almost 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:83924]

Description

Hi Ruby Friends!

Rubocop prefers #empty? over length == 0 and size == 0, which is great for String, Array, Hash, etc. It would be nice if more classes implemented #empty? for consistency.

See related discussion at https://github.com/bbatsov/rubocop/issues/2841.

I started this work at https://github.com/ruby/ruby/pull/1759

Thanks!

Also available in: Atom PDF