Fun with Ruby method argument defaults
A quick overview of simple but powerful (if weird) techniques of (ab)using Ruby method argument defaults, like def read_data(file: raise(ArgumentError, '#read_data requires path to .txt'))
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
A quick overview of simple but powerful (if weird) techniques of (ab)using Ruby method argument defaults, like def read_data(file: raise(ArgumentError, '#read_data requires path to .txt'))
Post a comment