module Rudash
This module was written in order to give the predicate functions for R_.filter, R_.map, R_.each. to be called with any dynamic arguments as it can. What differante JavaScript from Ruby is that once you configured a function with a specific set of arguments then you must call it with that set or else you will get an exception. That is so useful for predicate functions that developer define out of the library scope. We send all the arguments to the developer defined lambda and if it's failed because of ArgumentError we call it recursively with less argument until success.
This module will contain tiny general utilities
This module will create the nested path when using R_.set on not existing paths If we've a hash as { a: 1 } and we run R_.set(hash, 'a.b.c.d', 5) then we want to create the whole path ['a', 'b', 'c', 'd'] as embedded hashes. If we have some string that matches a number then we create an array.
This module have the logic of resolving the paths for R_.get, R_.set and R_.update. The resolve method will transform the path 'a.b.c.d' to ['a', 'b', 'c', 'd', '0']. The mentioned functions above can get the path in either way but we want to normilize the string path to the array shape in order to make the logic related only to one data structure.
This module was written to supply complex subset deep hash and array matching in order to give filter, some?, every? and find the ability to deep match with complex hash query. See test_filter_hashes_by_deep_hash (test/filter.rb)
Constants
- VERSION