Skip to content

Instantly share code, notes, and snippets.

# what is better? (considerenig all problems/caveates such as easy reading, err prones, efficient)
return body.is_a?(Hash) ? body['foo'] : nil
# or
body['foo'] rescue nil