Ruby Basic Terms Flashcards
An attribute is a _____________ that an ____________ hasQuality object
Quality object
A ________________ is something an object has the ability to do
method
the ; is a _______________________
terminator
A string is a collection of _________________________
characters
Concatenation is the ____________ of two or more strings
joining
the puts command always includes a ________________________________ after the command is executed.
line break
print does not have a line ____________.
break
p is a way of having a more _______________ line break
descriptive
an expression is an evaluation that includes some form of an ______________
operation
an operator is a __________________ that does something
symbol
the plus sign can be used as a ____________________ tool
concatenation
in ruby variable _____________ do not have to be declared
types
____________ is the ruby representation of the absence of a value
nil
which method converts a number to a string
.to_s
which method converts a string to an integer
.to_i
if you want to figure out what class an object is in after it type _________
.class
if you want to figure out what class an object is in after it type _________
.class
p x.5.floor rounds the number x to the _________________ nearest integer
lowest
p 10.5._________ rounds the number x to the highest nearest integer
ceil
_______________ is when you look through code to make it more efficient
refactoring
A shorter way of writing a = a + 5 is ____________
a += 5
When you use single quote you can’t _______________.
interpolate
True or False? All capital letters are less than lower case letters alphabetically in Ruby.
true
What is the shovel operator for strings?
«
The .concat(variable) ________________ the existing variable
overrides
What is it called when you put multiple methods together?
method chaining
The class name for a boolean object is a _______________
trueclass
The ___________ position is the location of something
index
When using two dots for the range method the right side is ________
included
When using 3 dots for the range method the right side is _______
not included
/n creates a _______ in a string
line break
What syntax is used to select a single character for a string?
[ ]
A method is first ____________ and then it is _______________
defined invoked
The names we give to the inputs are called ____________
parameters
A ________________ is a statement that controls if a piece of code executes
conditional
A conditional statement always returns a __________ value
boolean
The only two inherently falsie values in Ruby are ______________________.
false & nil
The ______ symbol is used when checking multiple truth statements that all need to be true
&&
The _____ symbol is used when you want to check conditions using OR
||
= is the __________ operator
assignment
== is the ____________ operator
comparison
Another word for a range is an _____________
interval
The ____________ turns a range into an array
.to_a