Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created November 12, 2019 10:36
Show Gist options
  • Select an option

  • Save krisleech/f23c5557bca4aa8be1bd0e66a7c71fdc to your computer and use it in GitHub Desktop.

Select an option

Save krisleech/f23c5557bca4aa8be1bd0e66a7c71fdc to your computer and use it in GitHub Desktop.
differentiating nil from nothing
Nothing = Object.new
result = [1,nil,2,4,nil].find(Nothing) { |i| i == nil }
if result == Nothing
else
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment