Skip to content

Instantly share code, notes, and snippets.

@reinh
Created July 28, 2010 17:55
Show Gist options
  • Select an option

  • Save reinh/495546 to your computer and use it in GitHub Desktop.

Select an option

Save reinh/495546 to your computer and use it in GitHub Desktop.
def short_circuit_fetch(*keys)
result = self
keys.each do |key|
result = result[key]
break unless result
end
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment