Creating and Calling a Method : Method Creation « Method « Ruby
- Ruby
- Method
- Method Creation
Creating and Calling a Method
def greeting
puts "Hello, pilgrim."
end
# As you already know, you call a method simply by giving its name:
greeting
Related examples in the same category