Project

General

Profile

Actions

Feature #8564

open

Extend Module#attr... methods

Added by Anonymous over 8 years ago. Updated almost 7 years ago.

Status:
Open
Priority:
Normal
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