MoreCoreExtensions are a set of core extensions beyond those provided by ActiveSupport.
MoreCoreExtensions are a set of core extensions beyond those provided by ActiveSupport.
#compact_map
- Collect non-nil results from the block#delete_blanks
- Deletes all items where the value is blank#delete_nils
- Deletes all items where the value is nil#deep_delete
- Deletes nested hash key elements#duplicates
- Returns an Array of the duplicates found#element_counts
- Returns a Hash of each element to the count of those elements#include_all?
- Returns whether the Array contains all of the items#include_any?
- Returns whether the Array contains any of the items#include_none?
- Returns whether the Array contains none of the items#includes_index?
- Returns whether the Array has a value at the index#mean
- Returns the mean of an Array of Numerics#stddev
- Returns the standard deviation of an Array of Numerics#variance
- Returns the variance of an Array of Numerics#delete_blank_paths
- Deletes all paths where the value is blank#random_index
- Picks a valid index randomly#random_element
- Picks an element randomly#tabular_sort
- Sorts an Array of Hashes by specific columns.stretch
- Stretch all argument Arrays to make them the same size.stretch!
- Stretch all argument Arrays to make them the same size. Modifies the arguments in place.#stretch
- Stretch receiver to be the same size as the longest argument Array.#stretch
! - Stretch receiver to be the same size as the longest argument Array. Modifies the receiver in place.#zip_stretched
- Zip arguments stretching the receiver if necessary#tableize
- Create a string representation of receiver in a tabular format if receiver is an Array of Arrays or an Array of Hashes#descendant_get
- Returns the descendant with a given name#hierarchy
- Returns a tree-like Hash structure of all descendants.#lineage
- Returns an Array of all superclasses.#leaf_subclasses
- Returns an Array of all descendants which have no subclasses.#delete_blanks
- Deletes all keys where the value is blank#delete_nils
- Deletes all keys where the value is nil#deep_delete
- Deletes nested hash key elements#delete_blank_paths
- Deletes all paths where the value is blank#sort!
- Replace the original with the sorted hash#sort_by!
- Replace the original with the sorted_by hash#cache_with_timeout
- Creates singleton methods that cache the results of the given block, but only for a short amount of time..clear_all_cache_with_timeout
- Globally clears all cached values across all classes.#namespace
- Returns an Array with the namespace to the current Module#clamp
- Clamp a number to a minimum and/or maximum value#square
- Returns the square of a Numeric#round_down
- Round down to the specified precision#round_up
- Round up to the specified precision#deep_send
- Invokes the specified methods continuously, unless encountering a nil value.#in_namespace?
- Returns whether or not the object is in the given namespace.pause
- Pauses a process.resume
- Resumes a paused process.alive?
- Returns whether or not a process is running#step_value
- Step through a range at a given increment#decimal_si_to_big_decimal
- Returns a BigDecimal based on the number and suffix given#decimal_si_to_f
- Returns a Float based on the number and suffix given#email?
- Returns whether or not the String is an= valid email#domain_name?
- Returns whether or not the String is a valid domain name#hostname?
- Returns whether or not the String is a valid hostname#ipv4?
- Returns whether or not the String is an IPv4 address#ipv6?
- Returns whether or not the String is an IPv6 address#ipaddress?
- Returns whether or not the String is an IPv4 or IPv6 address#integer?
- Returns whether or not the String is an integer#guid?
- Returns whether or not the String is a valid GUID#hex_dump
- Dumps the string in a hex editor style format#iec_60027_2_to_i
- Convert strings with an IEC60027-2 suffix to an integer#to_f_with_method
- Converts to a Float while also evaluating a method invocation#to_i_with_method
- Converts to an Integer while also evaluating a method invocation#number_with_method?
- Determines if the object contains a number with a method invocation#to_i
- Returns the integer value of a symbol#deep_clone
- Performs a Marshal based deep clone#delete_path
- Delete the value at the specified nesting#fetch_path
- Fetch the value at the specified nesting#find_path
- Detect which nesting holds the specified value#has_key_path?
- Check if a key exists at the specified nesting#include_path?
- alias of #has_key_path?
#key_path?
- alias of #has_key_path?
#member_path?
- alias of #has_key_path?
#store_path
- Store a value at the specified nestingAdd this line to your application’s Gemfile:
gem 'more_core_extensions'
And then execute:
$ bundle
Or install it yourself as:
$ gem install more_core_extensions
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)The gem is available as open source under the terms of the MIT License.