Ruby Primitive Data Types

Ruby is an object-oriented language, all its supported data types are implemented as classes. In Ruby, There are six types of Datatypes.

1. Numbers: A number is defined as a series of digits that use a dot as a decimal mark.

2. Boolean: It represents only one bit of information that says whether the value is true or false.

3. Strings: String is made up of multiple characters. It is defined by enclosing a set of characters within a single () or double (“”) quotes.

4. Arrays: An array can store data or multiple data items. It can contain all types of data.

5. Hashes: Arrays are collections of objects that are called Hash. However, hashes have a different storage format and way to define each object within the collection.

6. Symbols: It is a light-weight strings. A symbol is defined by a colon (:). It is used instead of strings because it can take up much less memory.