Understanding Ruby's data types makes it much easier to use methods, check conditions, and work with collections. The most commonly used ones in Ruby are String, Integer, Float, Boolean, Nil, Array, and Hash.
ruby
name = "Ruby" # String
age = 25 # Integer
price = 10.99 # Float
is_fun = true # TrueClass
nothing = nil # NilClass
puts name.class
puts age.class
puts price.class
puts nothing.nil?.class shows an object's class/type. nil? returns true or false depending on whether the value is nil.
You should see
String Integer Float trueInfo
nil means the absence of a value. It's not the same as an empty string "".