Skip to content

chaunce/deeply_enumerable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeeplyEnumerable

Extend Enumerable objects with recursive methods

Usage

Provides the following methods

$ DeeplyEnumerable::Hash#reverse_deep_merge(DeeplyEnumerable::Hash)
$ DeeplyEnumerable::Hash#reverse_deep_merge!(DeeplyEnumerable::Hash)
$ DeeplyEnumerable::Hash#deep_compact
$ DeeplyEnumerable::Hash#deep_compact!

$ DeeplyEnumerable::Array#deep_compact
$ DeeplyEnumerable::Array#deep_compact!

Nested Enumerable objects will be converted into DeeplyEnumerable type objects during merge or compact operations to allow recursive method calls

Class methods may be used for base ruby enumerable objects, such as Hash or Array objects

$ DeeplyEnumerable::Hash.deep_compact(Hash)
$ DeeplyEnumerable::Array.deep_compact(Array)

These methos will retrun a DeeplyEnumerable type object matching the object passed, e.g: Array will return a DeeplyEnumerable::Array

You may also extend base classes if you require: "base_extensions" as described in Installation

$ Hash#reverse_deep_merge(DeeplyEnumerable::Hash)
$ Hash#reverse_deep_merge!(DeeplyEnumerable::Hash)
$ Hash#deep_compact
$ Hash#deep_compact!

$ Array#deep_compact
$ Array#deep_compact!

Installation

Add this line to your application's Gemfile:

gem "deeply_enumerable"

or this line to extend the base Enumerable classes:

gem "deeply_enumerable", require: "base_extensions"

And then execute:

$ bundle

Or install it yourself as:

$ gem install deeply_enumerable

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages