Valid XHTML 1.0! Valid CSS!

New names for old things

Ruby uses special names for things that we already know. For instance, it uses the word Float to mean "decimals". Here are more definitions:

You've already seen thee classes for things that you already know:

Old nameRuby class
integer Integer
decimals Float
text String

You have also seen several methods:

Class Some methods
Integer + - / * % **
Float + - / * % **
String capitalize, reverse,
length, upcase

Classes vs objects

Make sure you understand the difference between classes and objects. An object is a unit of data. A class is what kind of data it is.

For example, 3 and 5 are different numbers. They are not the same object. But they are both integers, so they belong to the same class. Here are more examples:

   2 Integer
-5 Integer
7.2 Float
3.14 Float
'hello' String
'world' String

Class#method notation

Remember, different classes have different methods. Here are some differences that you have already seen.