HF RL Explorer

Task: Elegant Type Checking for Hash and Array in Ruby

Task: Elegant Type Checking for Hash and Array in Ruby: a task in Terminal-Lego-15k (Harbor dataset). Write a Ruby script that demonstrates elegant ways to check whether a variable is a Hash or an Array , replacing the verbose pattern of variable.class.to s == 'Hash' .

The task

Write a Ruby script that demonstrates elegant ways to check whether a variable is a `Hash` or an `Array`, replacing the verbose pattern of `variable.class.to_s == 'Hash'`.

Part of PrimeIntellect/Terminal-Lego-15k.