LRTHW: Word Drills Flashcards Preview

Ruby > LRTHW: Word Drills > Flashcards

Flashcards in LRTHW: Word Drills Deck (16)
Loading flashcards...
1
Q

class

A

tell ruby to make a new kind of thing

2
Q

object

A

two meanings: the most basic kind of things, and any instance of some thing

3
Q

instance

A

what you get when you tell Ruby to create a class

4
Q

def

A

How you define a function inside a class

5
Q

@

A

inside the functions in a class, @ is the operator for variables in the instance/object being accessed

6
Q

inheritance

A

the concept that one class can inherit trains from another class, much ike you and your parents

7
Q

composition

A

the concept that a class can be composed of other classes as parts, much like how a car has wheels

8
Q

attribute

A

a property classes have that are from composition and are usually variables

9
Q

is-a

A

A phrase to say that something inherits from another, as in a Salmon is-a Fish

10
Q

has-a

A

A phrase to say that something is composed of other things or has a trait, as in Salmon has-a mouth

11
Q

class X(Y)

A

Make a class named X that is-a Y

12
Q

class X(object def initialize(J)

A

class X has-a initialize that takes J paramaters

13
Q

class X(object) def M(J)

A

class X has-a function named M that takes J parameters

14
Q

foo = x()

A

Set foo to an instance of class X

15
Q

foo.M(J)

A

from foo get the M function and call it with parameters J

16
Q

foo.K = Q

A

From foo get the K attribute and set it to Q