There are two types of methods ・ What is prepared in Ruby (gets / puts / chomp / to_i etc.) ・ What you make yourself Divide into
An image of what kind of program to make ·name of the class ・ Class method ・ Class variables Let's think separately (I couldn't distinguish)
When creating a class method Can be used when repeating common processing or counting up
Since instance variables are processed individually Instance creation is created when you want to process individually sorted
self./@/@@/initialize
self. → Class method
@ → Instance variable
@@ → Class variables
initialize → Here is where you want to make initial settings
Recommended Posts