Sha256: 285814c6e8fb9ccd1692286f7add2835629660a80cbeeb1a65711f325574ab98
Contents?: true
Size: 955 Bytes
Versions: 8
Compression:
Stored size: 955 Bytes
Contents
# frozen_string_literal: true require 'fog/core/collection' require 'fog/aliyun/models/storage/directory' module Fog module Storage class Aliyun class Directories < Fog::Collection model Fog::Storage::Aliyun::Directory def all containers = service.get_containers return nil if containers.nil? data = [] i = 0 containers.each do |entry| key = entry['Prefix'][0] key[-1] = '' data[i] = { key: key } i += 1 end load(data) end def get(key, options = {}) if !key.nil? && key != '' && key != '.' dir = key + '/' ret = service.head_object(dir, options) new(key: key) if ret.data[:status] == 200 else new(key: '') end rescue Fog::Storage::Aliyun::NotFound nil end end end end end
Version data entries
8 entries across 6 versions & 2 rubygems