[Ruby] Output using methods and constants Learning notes

less than 1 minute read

It is a learning memo.

Output as is

puts "My favorite is sea urchin!"

Output using ### method

class Favorite
   def self.food
     puts "My favorite is sea urchin!"
   end
end

Favorite.food

Output using ### constants

FAVORITE = "I love sea urchin!"

puts FAVORITE