Issue #12046 has been updated by Yukihiro Matsumoto.

Status changed from Open to Rejected

as a rule, `attr_reader x` creates an instance variable `@x`, but we cannot have `@x?`.
that's the reason, we reject `attr_reader :foo?`. If you have any concrete use-case for
the new (more complex) behavior, please tell me.

Matz.

----------------------------------------
Feature #12046: Allow attr_reader :foo? to define instance method foo? for accessing @foo
https://bugs.ruby-lang.org/issues/12046#change-56999

* Author: Kenta Murata
* Status: Rejected
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
Now we should write an accessor method of a boolean instance variable like

```ruby
def foo?
  @foo
end
```

But I want to write it by using attr_reader like:

```ruby
attr_reader :foo?
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>