Use def to define a function : def « Method « Ruby






Use def to define a function



def dog_barking
  puts "Woof!"
end

dog_barking
    

 








Related examples in the same category

1.def and end define the welcome method:
2.define your own method with def/end