Skip to content

Tag Archives: Ruby Hash-class

Hash#invert() is a Hash class method which gives the hash by reverting keys to values and values to key. Syntax: Hash.invert() Parameter: Hash values Return:… Read More
Hash#to_s() is a Hash class method which gives the string representation of hash. Syntax: Hash.to_s() Parameter: Hash values Return: string representation of hash Example #1… Read More
Hash#inspect() is a Hash class method which gives the string representation of hash. Syntax: Hash.inspect() Parameter: Hash values Return: string representation of the hash Exaample… Read More
Hash#include?() is a Hash class method which checks whether the given key is present in hash. Syntax: Hash.include?() Parameter: Hash values Return: true – if… Read More
Hash#has_value?() is a Hash class method which checks whether the given value is present in hash. Syntax: Hash.has_value?() Parameter: Hash values Return: true – if… Read More
Hash#>=() is a Hash class method which compares two Hash values. Syntax: Hash.>=() Parameter: Hash values Return: true – if a >= b otherwise return… Read More
Hash#dig() is a Hash class method which finds the nested value which is specified by the sequence of the key object by calling dig at… Read More
Hash#each() is a Hash class method which finds the nested value which calls block once for each key in hash by passing the key-value pair… Read More
Hash#each_key() is a Hash class method which finds the nested value which calls block once for each_key key in hash by passing the key pair… Read More
Hash#each_pair() is a Hash class method which finds the nested value which calls block once for each pair in hash by passing the key_value pair… Read More
Hash#each_key() is a Hash class method which finds the nested value which calls block once for each_key pair in the hash by passing the key… Read More
Hash#empty?() is a Hash class method which checks whether the Hash array has any key-value pair.  Syntax: Hash.empty?()Parameter: Hash valuesReturn: true – if no key… Read More
Hash#eql?() is a Hash class method which checks whether the two Hash arrays are equal or not. Syntax: Hash.eql?() Parameter: Hash values Return: true –… Read More
Hash#fetch() is a Hash class method which returns a value from the hash for the given key. With no other arguments, it will raise a… Read More
Hash#fetch_values() is a Hash class method which returns array containing the values associated with the given keys. With no other arguments, it will raise a… Read More