Sha256: 372f3e2a5a98f0e451a4e046164af2d82a864b0c39cbda150696fb17ad08c303
Contents?: true
Size: 1.02 KB
Versions: 10
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'fog/core/model' require 'fog/aliyun/models/storage/files' module Fog module Storage class Aliyun class Directory < Fog::Model identity :key def destroy requires :key prefix = key + '/' ret = service.list_objects(prefix: prefix)['Contents'] if ret.nil? puts ' Not found: Direction not exist!' false elsif ret.size == 1 service.delete_container(key) true else raise Fog::Storage::Aliyun::Error, ' Forbidden: Direction not empty!' false end end def files @files ||= begin Fog::Storage::Aliyun::Files.new( directory: self, service: service ) end end def public_url nil end def save requires :key service.put_container(key) true end end end end end
Version data entries
10 entries across 8 versions & 2 rubygems