Sha256: 577de47ac1d6ffe185f1822da99bdf4572edfe0b8bb7c418237d922d25b6ed5e
Contents?: true
Size: 1.09 KB
Versions: 2
Compression:
Stored size: 1.09 KB
Contents
require 'fog/core/collection' require 'fog/external/models/storage/file' module Fog module Storage class External class Files < Fog::Collection attribute :directory model Fog::Storage::External::File def all requires :directory load(connection.remote.list_files(directory.key)) end def get(id) requires :directory data = connection.remote.get_file(file_key(id)) if data new(data) else nil end end def head(id) # hackish! requires :directory data = connection.remote.head_file(file_key(id)) if data new(data) else nil end end def new(attributes = {}) requires :directory super({ :directory => directory }.merge!(attributes)) end private def file_key(id) ::File.join(directory.key, id) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-external-0.0.3 | lib/fog/external/models/storage/files.rb |
fog-external-0.0.2 | lib/fog/external/models/storage/files.rb |