Project

General

Profile

Actions

Feature #14025

open

#initialize with ivars

Added by frankpimenta (Frank Pimenta) about 7 years ago. Updated about 7 years ago.

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

Description

For:

class Person
def initialize name = 'person'
@name = name
end
end

I thought that the following would be nice:

class Person
initialize :name
end

class Person
initialize name: 'person', age: 18
end

class Person
def initialize @name="person", @age=18
puts "initializing...something to run before"
end
end

--
B., Frank.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0