Chapter 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is IRB?

A

irb stands for “Interactive Ruby.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Are semicolons needed?

A

No, unlike other languages like C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Interger?

A

Whole Number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Floating point number?

A

Number with decimal places.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Class?

A

Is a Blueprint of Obects.

A class is the definition of a single type object.

Classes can inherit features from other classes, but still have unique features of their own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

attr_accessor?

A

provides attributes for a class.

attr stands for “attribute,” and accessor roughly means “make these attributes accessible to be set and changed at will.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Object?

A

Is an instance of a class.

A class is the classification, whereas an object is the actual object or “thing” itself.
 object is a single thing based on a class. (such as a “Chris” or a “Mrs. Smith”).

Classes can inherit features from other classes, but still have unique features of their own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Object orinetation?

A

Object orientation is the approach of using classes and objects to model real-world concepts in a programming language, such as Ruby.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Instance of a class?

A

is a specific realization of any object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Puts vs Prints?

A

The difference between print and puts is that puts automatically moves the output cursor to the next line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Inheritance?

A

Inheritance allows different classes to relate to one another and group concepts by their similarities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The < operator, in Classes?

A

Denotes class is inherited from.

class Cat < Pet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Methods?

A

They make objects perform actions.

A method represents a set of code (containing multiple commands and statements) within a class and/or an object.

class Dog < Pet

def bark
puts “Woof!”
end
end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In Ruby everything is a class.

A

Use Puts example.class to find out which class they’re a member of. eg. number is from fixnum.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Kernel Module?

A
module—a special type of class packed full of standard, commonly used methods,
 making your code easier to read and write.

puts “Hello, world!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Subroutine

A

a sort of method that has no associated object or class.

17
Q

a procedure, function, or subfunction VS Method

A

In a language such as Perl or C, this method would be called a procedure, function, or subfunction,
as method is a word generally used to refer to an action that can take place upon an object.