-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlearning_chapter1.rb
More file actions
27 lines (15 loc) · 873 Bytes
/
learning_chapter1.rb
File metadata and controls
27 lines (15 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Ruby is an interpreted language, don't need to compile Ruby code before executing
#don't need to declare variables before assigning them or specify a type
# #comments
#"string"
#if you include a #{...} in a ruby string, expression within the braces interpolated in
#the string
#method calls may need 1 or mor more arguments, separated by commas
#parenthesis optional around method arguments, leave them off if not passing arguments
#use the inspect and p methods to view debug output for Ruby objects
#can include special characters within double-quoted strings by using escape sequences
#\n and \t
#call to_s on almost any object to convert it to a string.
#Call to_i on a string to convert to an integer
#unless is the opposite of if (code won't execute unless a statement is false)
#until is opposite of while (executes repeatedly untul condition is true)