Project

General

Profile

Actions

Feature #8564

open

Extend Module#attr... methods

Added by Anonymous over 11 years ago. Updated almost 10 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:55623]

Description

Extend #attr_reader, #attr_writer, #attr_accessor syntax to accept default values, such as:

attr_reader foo: 42, bar: 43

Possibility of closures evaluated at initialization time might also be considered:

attr_reader baz: -> { Time.now }, quux: 42
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0