Tsallaka zuwa abun ciki
Justice Tech School

Everything Is an Object

Numbers, strings and nil are objects with methods. Call methods with a dot.

Example
puts 5.class, "hi".class, nil.class, :sym.class
puts 5.even?, "abc".upcase, 3.14.round

Result

Integer
String
NilClass
Symbol
false
ABC
3

Exercise

Class of a value.

5.

Quiz Test

Is nil an object?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.