Actions
Feature #19898
openSpecial syntax for instance variable assignment
Status:
Open
Assignee:
-
Target version:
-
Description
Since keyword arg assignment is already DRY with omitting of argument of the same name, what about DRYing out an instance var assignment? Something like this, with "@" for example, since it's already used to assign instance vars / memoize
def initialize(payload)
@payload = payload
end
def abc(d)
@d = d
end
# to be have a short from of
def initialize(@payload)
end
def abc(@d)
end
Updated by nobu (Nobuyoshi Nakada) about 1 year ago
- Is duplicate of Feature #5825: Sweet instance var assignment in the object initializer added
Actions
Like0
Like0