Project

General

Profile

Actions

Feature #12046

closed

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

Added by mrkn (Kenta Murata) about 8 years ago. Updated over 7 years ago.

Status:
Rejected
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 5 (3 open2 closed)

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 namesAssignedmatz (Yukihiro Matsumoto)Actions
Related to Ruby master - Feature #19708: Support `attr_reader :foo?`OpenActions
Is duplicate of Ruby master - Feature #10720: A proposal for something like: attr_reader :foo? - with the trailing '?' question markRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0