Ruby | Hash shift() method
Hash#shift() is a Hash class method which removes a key-value pair from hash and then it returns these value as two-item array. Syntax: Hash.shift() Parameter: Hash values Return: two-item [key-value] array Example #1 : Ruby # Ruby code for Hash.shift() method # declaring Hash value a = {a:455, b:20