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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

r.kakorin
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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature][ActiveSupport] Hash#deep_delete/1+ core extension

r.kakorin
Arity is a 1+ 

понедельник, 9 апреля 2018 г., 16:58:01 UTC+3 пользователь [hidden email] написал:
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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.