From: michaelpgee@... Date: 2017-11-29T14:42:54+00:00 Subject: [ruby-core:83974] [Ruby trunk Feature#14136] Implement #empty? on more classes Issue #14136 has been updated by mikegee (Michael Gee). There seems to be some confusion about what I'm asking for here. I know how to use these classes to make my code work. I'm not asking for help using the existing methods. I am proposing that all classes that implement `#size` or `#length` should also implement `#empty?` to let developers write clearer code. ---------------------------------------- Feature #14136: Implement #empty? on more classes https://bugs.ruby-lang.org/issues/14136#change-68054 * Author: mikegee (Michael Gee) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- 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! -- https://bugs.ruby-lang.org/ Unsubscribe: