Skip to content

Instantly share code, notes, and snippets.

@fronx
Created September 23, 2010 13:05
Show Gist options
  • Select an option

  • Save fronx/593582 to your computer and use it in GitHub Desktop.

Select an option

Save fronx/593582 to your computer and use it in GitHub Desktop.
class Array
def map_detect(&block)
result = nil
detect do |item|
result = block.call(item)
end
result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment