Section 1

Preview this deck

==; comparator/relational operator =; assignment operator !=; not equal

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (82)

Section 1

(50 cards)

==; comparator/relational operator =; assignment operator !=; not equal

Front

to signify equality in Ruby

Back

high-level (like English) interpreted (don't need compiler) object-oriented easy to use

Front

Ruby

Back

Front

looping with for

Back

#

Front

single-line comments in Ruby

Back

modifies the value contained within the variable

Front

! in Ruby

Back

first element 0 next element 1 and so on array[i]

Front

index in arrays (Ruby)

Back

strings in all upper or lower cases

Front

.upcase & .downcase

Back

numbers booleans strings

Front

three data types in Ruby

Back

for more than two options

Front

elsif in Ruby

Back

key-value pairs Hash.new creates a new hash pets = Hash.new pets["Stevie"] = "cat"

Front

hashes in Ruby

Back

super compact for loop

Front

.times in Ruby

Back

program that takes code and tuns it

Front

interpreter

Back

Front

iterating over arrays

Back

less than; < less than/equal to; <= greater than; > greater than/equal to; >=

Front

lesser than or greater than in Ruby

Back

start lowercase separated by underscores $ or @ mean different things

Front

naming conventions in Ruby

Back

name.method1.method2.method3

Front

chaining methods together in Ruby

Back

takes in string and returns an array divides the string when see a certain letter

Front

.split

Back

skills that certain objects have

Front

methods in Ruby

Back

inclusive or

Front

or in Ruby

Back

capitalizes first letter of string and rest lower case

Front

.capitalize

Back

takes an expression if expression true, executes what follows if if false, skips it if 1 > 2 print end

Front

if in Rugy

Back

evaluates to true if finds what it's looking for

Front

.include?

Back

length of the string

Front

.length

Back

+= - *= /= do the math and assign it to the variable

Front

assignment operator

Back

arrays inside arrays

Front

multidimensional arrays

Back

Front

accessing elements in multidimensional arrays

Back

when know how many times will be looping

Front

for loop in Ruby

Back

gives us flexibility different outcomes depending on information the user types

Front

control flow in Ruby

Back

backwards while

Front

until loop in Ruby

Back

when loop over an array or hash

Front

iterating in Ruby

Back

global substitution

Front

.gsub!

Back

checks to see if a certain condition is true while it is, the loop keeps running

Front

while loop in Ruby

Back

Front

not in Ruby

Back

string interpolation #{monkey} with the value of monkey

Front

outputs in Ruby

Back

gets.chomp gets; gets input from user chomp; removes extra line automatically made after gets

Front

getting input in Ruby

Back

pack multiple values into a single variable [1, 2, 3, 4]

Front

array in Ruby

Back

each line with # or =begin =end no space between = and begin/end

Front

multi-line comments in Ruby

Back

spits out backward version

Front

.reverse

Back

addition; + subtraction; - multiplication; * division; / exponentiation; ** modulo; % (remainder of division)

Front

math in Ruby

Back

print takes whatever and prints on screen puts adds new line after what is presented

Front

puts and print

Back

for false statements to run

Front

unless in Ruby

Back

three dots exclude last number two dots include the last number

Front

inclusive and exclusive ranges

Back

collection of all variables and their values that exist in the program at a given time

Front

environment in Ruby

Back

using iterator; invokes block of code

Front

loop method in Ruby

Back

word or name that grasps a single value name = value

Front

variable in Ruby

Back

if/else if 1 > 2 print else print end

Front

else in Ruby

Back

used to skip over certain steps in the loop

Front

next in Ruby

Back

type code in editor, interpreter reads code, and shows the result in the console

Front

editor

Back

apply expression to each element of an object, one at a time

Front

.each in Ruby

Back

logical/boolean operators and; && or; || not; !

Front

and in Ruby

Back

Section 2

(32 cards)

reverses the sequence

Front

reverse!

Back

a parameter what .each has been doing: taking block as parameter

Front

a method can take a block as

Back

.each_key .each_value

Front

only working with keys or values

Back

block disappears after performing

Front

blocks vs. methods

Back

always start with colon (:) valid Ruby variable name (first character has to be letter or underscore)

Front

how to write symbols

Back

way of creating methods that don't have a name defined with either keywords do and end or with curly braces

Front

blocks

Back

Front

default value for hash

Back

along with false, one of two non-true values

Front

nil

Back

1. header (def, name of method, and arguments) 2. body (describes procedures of method) 3. end

Front

three parts of methods

Back

reusable section of code written to perform specific task

Front

method

Back

make it into a string

Front

to_s

Back

else when any of when statements does not match

Front

case statement

Back

make good hash keys 1. immutable; can't be changed once created 2. only one copy exists; save memory 3. faster than strings-as-keys

Front

properties of symbols

Back

Front

iterating in hashes

Back

arguments preceded by * use when don't know how many arguments there are to be, but could be more than one

Front

splat arguments

Back

filtering hash for values that meet certain criteria

Front

.select

Back

by just typing the name

Front

calling a method

Back

keyword def

Front

methods are defined using

Back

.to_s .to_sym .intern (same as .to_sym)

Front

symbols to strings and vice versa

Back

1. colon at end of symbol 2. don't need hash rocket

Front

new hash syntax

Back

compare two objects <=> returns 0 if first operand (item to be compared) equals the second 1 if first operand is greater than the second -1 if first operand is less than second

Front

combined comparison operator

Back

method not to print something to the console but to hand us (or another method) a value

Front

return

Back

Front

iterating in multidimensional arrays

Back

Front

setting default value for hash

Back

it accepts or expects the arguments argument; piece of code actually put between method's parentheses when calling parameter; name you put between the method's parentheses when you define it

Front

if a method takes arguments

Back

sort the array returns array of arrays

Front

.sort_by

Back

.sort! method .sort sorts a copy while sort! destroys the original and replaces with sorted version

Front

sorting

Back

sort of a name symbols are not strings key behavior; while there can be multiple different strings that all have the same value, there's only one copy of any particular symbol at a given time two "strings" are different objects while two :symbols are the same object

Front

symbols in Ruby

Back

second parameter will default to false if user doesn't type in two arguments

Front

two parameters in method

Back

Front

two ways of creating hashes

Back

great way of abstracting certain tasks from the method and defining those tasks when we call the method

Front

passing a block to a method

Back

Front

iterating over hashes

Back