Everything Is An Object in Ruby (Proof)
Learn about the class of different objects in Ruby.
We'll cover the following
The is_a?
method
We know that 123.class
returns an integer, and blabla
.class returns a string. However, every object also has is_a
? method, which returns either true
or false
, depending on the parameter we’re passing to that method:
$ irb
> 123.is_a?(Integer)
=> true
Get hands-on with 1400+ tech skills courses.