Project

General

Profile

Feature #14680

Adding +@ and -@ to hash and array

Added by kddeisz (Kevin Deisz) about 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:86513]

Description

Since we have -@ and +@ for strings and it's very useful (and reads better than .freeze) I'd like to propose adding the same API to hash and array. Especially with constants, linters are always telling me to freeze them, and I'd like to be able to accomplish that with -@. I've attached the necessary code to make that happen.


Files

freeze.patch (3.86 KB) freeze.patch kddeisz (Kevin Deisz), 04/11/2018 02:49 PM

Also available in: Atom PDF