Project

General

Profile

Actions

Feature #14136

open

Implement #empty? on more classes

Added by mikegee (Michael Gee) almost 7 years ago. Updated about 6 years ago.

Status:
Open
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!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0