Progate learning notes Get confusing
What is written like this.
def info
#processing
end
Methods defined in the class and called for the instance
#Menu class
class Menu
# recommended_A class method called menu
def recommended_menu(name)
return "Today's recommendation#{name}is."
end
end
#instance
menu = Menu.new
#Recommended for the instance_Call the menu method
puts menu.recommended_menu("Meita bread")
Execution result ↓
Today's recommendation is menta bread.
Reference: Progate