Class: TheTvDB::Response::Unzip

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/the_tv_db/response/unzip.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/the_tv_db/response/unzip.rb', line 4

def on_complete(env)
  if env[:response_headers]["content-type"] == "application/zip"
    env[:body] = TheTvDB::Zip.new.inflate(env[:body])
  end
  
  super
end