Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created July 14, 2014 19:16
Show Gist options
  • Save havenwood/4d7d58577a5de4e24b20 to your computer and use it in GitHub Desktop.
Save havenwood/4d7d58577a5de4e24b20 to your computer and use it in GitHub Desktop.
Frank13760 IRC
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