Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # When anything, including nil, is a valid param and you need
- # a clear way to know if a param was set or not, use `None`.
- None = Object.new
- def foo(a, b=None)
- result = [a]
- if b != None
- result << b
- end
- result
- end
Add Comment
Please, Sign In to add comment