Skip to content
☈king edited this page Nov 19, 2012 · 3 revisions

Define a method.

TODO:

Describe various signatures

def foo

def foo arg

def foo arg, arg2

def foo *args

def foo arg, *args, arg3

…Ruby 2.0 keyword args?

Talk about eigenclasses

Doesn't work inside another def, but can work inside blocks. Compare to Module#define_method, which is capable of doing more dynamic tricks.

Clone this wiki locally