Ruby | Hash size() method
Hash#size() is a Hash class method which returns the count of key-value pair in the hash. Syntax: Hash.size() Parameter: Hash values Return: count of key-value pair in the hash. Example #1 : # Ruby code for Hash.size() method # declaring Hash value a = {a:100, b:200} # declaring Hash value b = {a:10