String
Integer
Float (number with decimal point)
Boolean value (either True or False)
Complex number
List (collection of data that can be mutated)
Dictionary (collection of data where each member references a value)
Addition
Unary positive, makes number positive
Subtraction
Unary negative, makes number negative
Multiplication
Division
Modulo (remainder of division)
Indice
Equals
a+=b is a=a+b
a-=b is a=a-b
a*=b is a=a*b
a/=b is a=a/b
a**=b is a=a**b
a%=b is a=a%b
Is equal to
Is not equal to
Greater than
Less than
Greater than or equal to
Less than or equal to
The spaceship; in a<=>b, returns 0 if a==b, 1 if a>b, and -1 if a<b
Returns true if both objects have same type and value
Returns true if both objects have the same object ID
Bitwise AND
Bitwise OR
Bitwise XOR
Arithmetic shift left (shifts all the bits one space to the left, essentially multiplying it by 2)
Logical shift right (shifts all the bits one space to the right, essentially dividing it by 2)
Bitwise NOT
AND operator
OR operator
NOT operator
Checks if two objects are the exact same object, not just the same value
Checks if two objects aren't the exact same object, even if they have the same value
Checks if an object is an element of another
Checks if an object isn't an element of another
Applies method to object
References global instance of a variable name
References instance of a variable name within a certain scope
Defines a array
References a array's index
Defines a list
Denotes parameters of a function
Defines a hash
Defines the actions of method blocks
Defines a lambda expression
Applies value to key in hash
Declares a string
Declares a string
Declares a class static variable
Declares a class instance variable
Declares a parent class of a class
Creates array including all numbers between the given range (inclusive of those two numbers)
The splat; indicates unknown amount of arguments for a parameter and treats them as one list
Pushes object onto list
Used for declaring lambda functions
Used for referencing the class' superclass
Used for declaring when statement in a case statement
Used for testing if two variables are the same
Used for applying and logic
Used for applying or logic
Used for applying not logic
Used for referencing objects in an array or string
Used for declaring foreign files as a variable
Used for importing foreign classes for use in code
Used to give a final value at the end of a method
Used to tell compiler to do nothing
Used to tell compiler to complete the next iteration of a loop
Used to tell compiler to end the loop
Used to import specific methods from class
Used for declaring loop
Used to handle function with variable for a portion of code
Used to handle class or variable with an alias name
Raises an error object
Used to declare public variable in a method
Deletes an object from memory
Represent a true boolean value
Represents a false boolean value
References the class instance
Declares a class
Declares a function
Switches logic flow based on the output of an expression
Executes code for every object in another object
Executes code for every object in list
list.each { |object| code }
Executes code n times
Executes code if condition is true
Executes code unless a condition is true
Executes code when if or elif isn't executed
if condition
code
else
code
end
Executes code on true condition if the last if statement was false
if condition
code
elsif condition
code
end
Attempts to execute code and jumps to the subsequent except on an error
Executes code on failed begin statement
Loops code while a condition is true
Loops code until a condition is true
Constructor of a class (method to make objects of a class)
def initialize(args)
code
end
Prints a message
Declares a new object to an array
list.push(object)
Returns length of an array
list.length
Removes last object from an array
array.pop
Includes foreign file's class
require module
Used to tell compiler the rest of this line is not to be compiled
#This isn't executed
Opens a multi line comment
Closes a multi line comment