Ruby by Example / Types
Every type in ruby is a class, so they use CamelCase
String
"Hello World"
Integer
1
Float
3.14
TrueClass
# there is no Boolean type
# true and false are different type
true
FalseClass
false
Array
# You can put any type of value inside of it
[1, "Hello", 3.14, false, true]
Sets
# It's like import or include in other language
require "set"
Set.new [1, 2, 3]
Hash
{:foo => 1}
# Or
{"foo": 1}
# Or
{foo: 1}
# Also you can
{1 => 2, list: [], true => false}