def and end define the welcome method: : def « Method « Ruby






def and end define the welcome method:



def welcome
  puts "Welcome to Ruby methods."
end

welcome

 








Related examples in the same category

1.Use def to define a function
2.define your own method with def/end