・ Data type -Alias: "Object blueprint" "Object template" -If the class is the same, the attributes (data items) held and the methods that can be used are the same.
・ A chunk of data created based on a class -When explaining the relationship with a method, it is sometimes called a receiver.
python
food = Food.new('apple', '7:00')
food.name
This code may be described as: "The second line calls the name method of the Food object." "The receiver for the name method here is food."
-A group of processes with a name.
python
food = Food.new('apple', '7:00')
food.name
"The second line sends the message name to the receiver called food."
-Data held for each object -Data such as "name" and "age" of the Food class is also included in the "Food status".
-A value that can be obtained from an object
python
food = Food.new('apple', '7:00')
food.name = 'apple'
reference An introduction to Ruby for those who want to become professionals
Recommended Posts