Ruby Keyword: def - rking/pry-docmore GitHub Wiki

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.

⚠️ **GitHub.com Fallback** ⚠️