class Paperclip::Upyun::Response

Public Class Methods

error(res) click to toggle source
# File lib/paperclip/upyun/response.rb, line 12
def self.error(res)
  raise Paperclip::Upyun::Exceptions::ResponseError, "#{res.to_s}"
end
parse(res) click to toggle source
# File lib/paperclip/upyun/response.rb, line 5
def self.parse(res)
  return true if res.is_a?(TrueClass)
  raise TypeError, "Upyun Response type: #{res.class}" unless res.is_a?(Hash)
  self.error(res) if res.has_key?(:error) || res.has_key?("error")
  true
end