A couple of brief notes on Ruby variables:
Variables are set with an = sign and can be reassigned at any time. They are named with snake_case instead of CamelCase.
good_dog = “Waffles”
Snake Case is so named because it looks like a winding snake, as_the_words_rise_and_fall_with_the_underscores. Camel Case is named for the “humps” each capital letter creates in the variable name: WafflesIsAGoodBoy.
In Ruby, variables cannot:
Start with a number
Be a reserved word
Have punctuation or spaces
So the below are not valid:
1goodBoy = “Waffles” if = “Good Boy” .waffles.is a good dog! = “Waffles”
Variables beginning with uppercase letters are - PLOT TWIST - constants. A constant is a variable that is just that. Its value cannot be changed. If I want to declare my dog, Waffles, to be the best boy in the universe for all time:
BEST_DOG_IN_THE_UNIVERSE = “Waffles”
A note re: interpolation: Interpolation is the act of using a variable as a stand-in inside a string and having Ruby (or the language you are using) evaluate that variable and fill in its value.
Note that this will only work with double quotes.