Project

General

Profile

Actions

Feature #19163

closed

Data object should be frozen

Added by matz (Yukihiro Matsumoto) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:52007]

Description

If we call initialize (via send), we can rewrite an existing Data object.

d=Data.define(:a, :b).new(1,2)
p d #=> #<data a=1, b=2>
d.send(:initialize, {a:3,b:4})
p d #=> #<data a=3, b=4>

Should we freeze the Data object after calling initialize for the first time?

Matz.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0