- 2 SPACE INDENTATION
- generally follow community style guide: bbatsov/ruby-style-guide
- rubocop.yml template
- prefer rspec over test-unit
- See here: Procs
- The shorthand for creating Procs is
Kernel.lambda
BUT WITH SOME SLIGHT DIFFERENCES:- lambdas check the number of parameters passed when called (throws
ArgumentError
) - A return from a
Proc
returns from the enclosing method whereas lambdas return control to the caller
- lambdas check the number of parameters passed when called (throws
- In general, prefer
lambda { }
overProc.new
to avoid surprising behavior.