Ruby Language
Goals
Steps
Step 1
Option 1.1: Without Docker
irbOption 1.2: With Docker
docker run -it --rm ruby:2.5.1-slimirb(main):001:0>Step 2
Next try some simple math that's built into Ruby. Type these lines into IRB:3 + 3 7 * 6Step 3
my_variable = 5Step 4
my_variable + 2 my_variable * 3Step 5
fruits = ["kiwi", "strawberry", "plum"]Step 6
Type this in the terminal:fruits = fruits + ["orange"] fruits = fruits - ["kiwi"]Step 7
Type this in the terminal:fruit_dictionary = { strawberry: "a sweet soft red...", plum: "an oval, purple fruit...", orange: "a round juicy citrus fruit..." }Step 8
Type this in the terminal:fruit_dictionary[:strawberry]Step 9
7.class "kiwi".class fruits.classStep 10
fruits.length fruits.firstfruits.methodsfruits.methods.sortarray = fruits.methods array.sortStep 11
fruits.each do |fruit| puts fruit endStep 12
if my_variable > 1 puts "YAY!" endif my_variable > 1 puts "YAY!" else puts "BOO!" endStep 13
def pluralize(word) word + "s" end pluralize("kiwi")Step 14
Next Step:
Go on to Getting Started