ruby

reserved words

variables

lower_case_separated_by_underscore (naming convention)

x = 1 (standard variable assignment)

$x = 1 (global)

'@x' = 1 (class)

'x=1' (instance)

(block)

x += 2 (same as x = x + 2)

data_types

integers

Fixnum (eg, 1234)

Bignum (eg, 1234567890123456789)

Float (eg, 123.45)

operations

arithmetic

'+ add'

'/ division'

'** squared'

'* multiplication'

strings

'i\'m escaped.' (backslash to escape)

x = "Hello" (variable assignment for a string)

x + ' ' + 'Holly' (concatenation)

x[0] (split string by index]

puts "\ta\na" (double quotes evaluates tabs, newlines etc)

puts "#{x} Holly" (double quotes allows variables to be evaluated in string"

"Hello".reverse.upcase[2] (string methods)

arrays

items = []

constants