-
-
Save havenwood/4d7d58577a5de4e24b20 to your computer and use it in GitHub Desktop.
Frank13760 IRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyApi | |
class Connection | |
def initialize(api_key, other_id) | |
@v1_client = MyApiClient::V1.new | |
end | |
def savings_totals(number) | |
status = Timeout.timeout(59) do | |
@v1_client.public_send("saving_totals_#{number}") | |
end | |
status.attributes.keys.include?("error") ? {} : status | |
rescue Timeout::Error | |
{} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment