Project

General

Profile

Actions

Feature #14025

open

#initialize with ivars

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

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