[Feature][ActiveSupport] Hash#deep_delete/0+ core extension

22 views
Skip to first unread message

r.ka...@potok.digital

unread,
Apr 9, 2018, 9:58:01 AM4/9/18
to Ruby on Rails: Core
Its a quite necessary feature which is needed for working with too large hashes, when you need to clear some data from specified fields which are located on different nesting levels, e.g. personal data. Its provides removing key-value pair in any level nesting of hash pair. 
Example: 
{ k: 1, v: { l: { t: 2 } } }.deep_delete(:t)
# => {:k=>1, :v=>{:l=>{}}

I have code for this feature and want to commit this.

r.ka...@potok.digital

unread,
Apr 9, 2018, 10:38:21 AM4/9/18
to Ruby on Rails: Core
Arity is a 1+ 

понедельник, 9 апреля 2018 г., 16:58:01 UTC+3 пользователь r.ka...@potok.digital написал:
Reply all
Reply to author
Forward
0 new messages