How to print a variable type

Hi, I am having a problem in my code. I want to know the type of a
variable. It can be of two types, a string or an array. Is there
something like

native_ruby_method_that_returns_var_type (var)

that returns a string like for instance ‘String’ or ‘Array’ ?

Hi, I am having a problem in my code. I want to know the type of a
variable. It can be of two types, a string or an array. Is there
something like

native_ruby_method_that_returns_var_type (var)

that returns a string like for instance ‘String’ or ‘Array’ ?

“string”.class
=> String

[1,2,3].class
=> Array