Skip to content

Instantly share code, notes, and snippets.

@mrb
Created September 8, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrb/0b2280be579b8439c87373fd3cff3489 to your computer and use it in GitHub Desktop.
Save mrb/0b2280be579b8439c87373fd3cff3489 to your computer and use it in GitHub Desktop.
def format(result)
# The data I want is deeply nested in the "result" hash
results = result.first[1]["coverage"]
end
@akahn
Copy link

akahn commented Sep 8, 2016

if result
  if result.first
    if result.first[1]
       if result.first[1]["coverage"]
         result.first[1]["coverage"]
       end
     end
   end
end

OR

result.first[1]["coverage"] rescue nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment