Skip to content

Tag Archives: Ruby Hash-class

Hash#replace() : replace() is a Hash class method which replaces the content of one hash with other. Syntax: Hash.replace() Parameter: Hash values Return: replaces the… Read More
Hash#==() : ==() is a Hash class method which checks the equality of two Hash values. Syntax: Hash.==() Parameter: Hash values Return: true – if… Read More
any?() is a Hash class method which checks for the presence of a pattern and passes each element of the collection to the given block.… Read More
assoc() is an Hash class method which searches an element through the Hash. Syntax: Hash.assoc() Parameter: Hashs for finding elements. Return: searches an element through… Read More
clear() is an Hash class method which removes all the Hash elements from it. Syntax: Hash.clear() Parameter: Hashs to clear off Return: Hash with all… Read More
compact () is a Hash class method which returns the Hash after removing all the ‘nil’ value elements (if any) from the Hash. Syntax: Hash.compact()… Read More
compact! () is a Hash class method which returns the Hash after removing all the ‘nil’ value elements (if any) from the Hash. If there… Read More
compare_by_identity? () is a Hash class method which checks the comparison of the hash key with its identity and considers exact same objects as same… Read More
delete() is an Hash class method which deletes the key-value pair and returns the value from hash whose key is equal to key. Syntax: Hash.delete()… Read More
delete_if() is a Hash class method which delete_if the key-value pair if the block condition is true Syntax: Hash.delete_if() Parameter: Hash array Block Condition Return:… Read More
rassoc() is an Hash class method which searches an element through the Hash value. Syntax: Hash.rassoc() Parameter: Hashs for finding elements. Return: searches an element… Read More