Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created September 28, 2016 17:05
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 anonymous/631e990ea2bea05655304465f58ba05e to your computer and use it in GitHub Desktop.
Save anonymous/631e990ea2bea05655304465f58ba05e to your computer and use it in GitHub Desktop.
def get_from_api
raise 'service unavailable'
end
def get_from_db
'foo'
end
def get_the_thing
begin
get_from_api
rescue
get_from_db
end
end
get_the_thing
# "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment