Skip to content

Instantly share code, notes, and snippets.

@jaturken
Created April 14, 2015 11:06
Show Gist options
  • Save jaturken/1615e4172fa364ae44e0 to your computer and use it in GitHub Desktop.
Save jaturken/1615e4172fa364ae44e0 to your computer and use it in GitHub Desktop.
user
def get_info
if storage == 'file'
get_info_from_file
elsif storage == 'mysql'
get_info_from_mysql
elsif storage == 'api'
get_storage_from_api
else
raise RuntimeError, 'Unknown storage'
end
end
private
def get_info_from_file
123
end
def get_info_from_mysql
234
end
def get_info_from_api
345
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment