Project

General

Profile

Feature #12046

Allow attr_reader :foo? to define instance method foo? for accessing @foo

Added by mrkn (Kenta Murata) over 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Normal
Target version:
-
[ruby-core:73644]

Description

Now we should write an accessor method of a boolean instance variable like

def foo?
  @foo
end

But I want to write it by using attr_reader like:

attr_reader :foo?

Related issues

Related to Ruby master - Feature #11167: Allow an attr_ variant for query-methods that end with a question mark '?' character, such as: def foo? returning @fooRejectedActions
Related to Ruby master - Feature #5781: Query attributes (attribute methods ending in `?` mark)Assignedmatz (Yukihiro Matsumoto)Actions
Related to Ruby master - Feature #15991: Allow questionmarks in variable namesOpenmatz (Yukihiro Matsumoto)Actions
Is duplicate of Ruby master - Feature #10720: A proposal for something like: attr_reader :foo? - with the trailing '?' question markRejectedActions

Also available in: Atom PDF