Ruby is a programming language that focuses on simplicity and productivity. It can be said that Ruby is easier to read and write because it seems more “natural”.
first_name = John
last_name = Smith
The above example is how you would assign a value to a variable. There are also some other data types that can be seen below
true_boolean = true
false_boolean = false # string
new_string = "String Value" # symbol
a_symbol = :symbol_here# float
float_value = 1.99
Control Flow: Conditional Statements
if 1 < 2
puts "1 is less than 2"
The above statement is a conditional statement that will print out the string because 1 is less than to, which makes that statement true.
num = 1
while num <= 10
num += 1
This example shows a while loop. The initial starting value is 1 and if it’s less than or equal to 10 then it will print out that number. After it does that, it will increment the value and continue on until it gets to 11 and then it will stop.
This is a good intro to data types, conditional statements, and loops. Feel free to check out the main Ruby site for more detailed information.