Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
define your own method with def/end : def « Method « Ruby
Ruby
Method
def
define your own method with def/end
def hello puts
"Hello, Matz!"
end hello # => Hello, Matz!
Related examples in the same category
1.
Use def to define a function
2.
def and end define the welcome method: