No documentation

This class has no description. You can help the Ruby community by adding new notes.

Show files where this class is defined (1 file)
Register or log in to add new notes.
February 12, 2009
2 thanks

Use this!

You should raise your own ArgumentError in methods to notify users of your class, if you think certain kinds of arguments aren’t acceptable.

def transfer_money(amount)
  unless amount.is_a?(Number)
    raise ArgumentError.new("Only numbers are allowed")
  # ... Do the actual work