Mod 1 Flashcards
are what allows us to store data in Ruby, containers
variable
a packet of instructions, a set of reusable code
methods
an input to a method
argument
guides for method, place hold for arguments
parameters
the result/ output of a method
return value
piece of data
object
running a command
execute
where less complex functionality is exposed in an interface and more complex functionality is suppressed
abstraction
why do we use methods
streamline, reusability, faster, DRY
how does abstract help us code
keeps complexity from users
is a description of how something should behave
Class
A type of of object (blueprint)
class
piece of data
object
a specific object (built from blueprint)
Instance
noun- what an object ‘is’, attributes that describe object
state
verb- what an object ‘does’ or what ‘can be done’ to an object, Methods that model object behavior
behavior
specific properties of an object
attribute
a type of variable that states with ‘@’
instance variable
is a hash or array
collection
is doing something several times
iteration
everything between do and end
block
=> | x |
block variable
used to extend or modify functionality in Ruby applications
Gem
the verification of the behavior we were expecting
assertion
S.E.A.T.
setup, execution, assertion, teardown
a choice depending on whether or not a condition is ‘true’ or ‘false’ (choose your own adventure)
conditional branching
a set of instructions that is executed repeatedly until some conditions is met
loop
in a loop what does while mean
execute as long as true
in a loop what does unitl mean
execute from false til true
what does loop do mean
code will run for ever
is what you have access to and where you have access to it
scope
anything not inside a scope is put into this default scope
global scope
a type of scope when we create a method
method scope
refers to what is available inside a block (everything between do and end)
block scope
refers to what is available in a class everything between class and end
class scope
represents a collection of named values (keys:values)
hashes
an immutable value
symbol
ruby programs that help us iterate
enumerable
go through code object by object
iteration
like each but reaturns a new array
.map
will return the first item in a collection that is truthy
.find
goes through total collection for that are truthy
.find_all