From 000fedfbfbc90f0a0bd336ad2f10722e539bef65 Mon Sep 17 00:00:00 2001 From: Steven Bazyl Date: Thu, 4 Oct 2012 15:31:46 -0700 Subject: [PATCH] Add method for checking if upload can be resumed --- lib/google/api_client/media.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/google/api_client/media.rb b/lib/google/api_client/media.rb index 8cba0a105..45726cded 100644 --- a/lib/google/api_client/media.rb +++ b/lib/google/api_client/media.rb @@ -100,6 +100,14 @@ module Google return @expired end + ## + # Check if upload is resumable. That is, neither complete nor expired + # + # @return [TrueClass, FalseClass] True if upload can be resumed + def resumable? + return !(self.complete? or self.expired?) + end + ## # Convert to an HTTP request. Returns components in order of method, URI, # request headers, and body